1f08c3bdfSopenharmony_ci#!/bin/sh 2f08c3bdfSopenharmony_ci# SPDX-License-Identifier: GPL-2.0-or-later 3f08c3bdfSopenharmony_ci# Copyright (c) 2016-2019 Oracle and/or its affiliates. All Rights Reserved. 4f08c3bdfSopenharmony_ci# Author: Alexey Kodanev <alexey.kodanev@oracle.com> 5f08c3bdfSopenharmony_ci 6f08c3bdfSopenharmony_ciTST_TESTFUNC="do_test" 7f08c3bdfSopenharmony_ciTST_NEEDS_ROOT=1 8f08c3bdfSopenharmony_ciTST_NEEDS_CMDS="cut clockdiff" 9f08c3bdfSopenharmony_ci 10f08c3bdfSopenharmony_ci 11f08c3bdfSopenharmony_cido_test() 12f08c3bdfSopenharmony_ci{ 13f08c3bdfSopenharmony_ci tst_res TINFO "check time delta for $(tst_ipaddr)" 14f08c3bdfSopenharmony_ci 15f08c3bdfSopenharmony_ci local output=$(clockdiff $(tst_ipaddr)) 16f08c3bdfSopenharmony_ci 17f08c3bdfSopenharmony_ci if [ $? -ne 0 ]; then 18f08c3bdfSopenharmony_ci tst_res TFAIL "clockdiff failed to get delta" 19f08c3bdfSopenharmony_ci else 20f08c3bdfSopenharmony_ci delta=$(echo "$output" | cut -d' ' -f2,3) 21f08c3bdfSopenharmony_ci if [ "$delta" = "0 0" ]; then 22f08c3bdfSopenharmony_ci tst_res TPASS "delta is 0 as expected" 23f08c3bdfSopenharmony_ci else 24f08c3bdfSopenharmony_ci tst_res TFAIL "not expected data received: '$output'" 25f08c3bdfSopenharmony_ci fi 26f08c3bdfSopenharmony_ci fi 27f08c3bdfSopenharmony_ci} 28f08c3bdfSopenharmony_ci 29f08c3bdfSopenharmony_ci. tst_net.sh 30f08c3bdfSopenharmony_citst_run 31