• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
11do_test()
12{
13	tst_res TINFO "check time delta for $(tst_ipaddr)"
14
15	local output=$(clockdiff $(tst_ipaddr))
16
17	if [ $? -ne 0 ]; then
18		tst_res TFAIL "clockdiff failed to get delta"
19	else
20		delta=$(echo "$output" | cut -d' ' -f2,3)
21		if [ "$delta" = "0 0" ]; then
22			tst_res TPASS "delta is 0 as expected"
23		else
24			tst_res TFAIL "not expected data received: '$output'"
25		fi
26	fi
27}
28
29. tst_net.sh
30tst_run
31