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