test: fix packet interval check

This commit is contained in:
Miroslav Lichvar 2014-06-03 14:18:48 +02:00
parent 28876d6afa
commit 34f12c0864
4 changed files with 10 additions and 10 deletions

View file

@ -27,16 +27,16 @@ server_conf=""
run_test || test_fail
check_chronyd_exit || test_fail
# These checks must fail as the server doesn't know the key
# This check must fail as the server doesn't know the key
check_sync && test_fail
check_packet_interval && test_fail
check_packet_interval || test_fail
server_conf="keyfile tmp/keys"
client_conf=""
run_test || test_fail
check_chronyd_exit || test_fail
# These checks must fail as the client doesn't know the key
# This check must fail as the client doesn't know the key
check_sync && test_fail
check_packet_interval && test_fail
check_packet_interval || test_fail
test_pass

View file

@ -19,9 +19,9 @@ allow 192.168.124.0/24"
do
run_test || test_fail
check_chronyd_exit || test_fail
check_packet_interval || test_fail
# These checks are expected to fail
check_source_selection && test_fail
check_packet_interval && test_fail
check_sync && test_fail
done

View file

@ -29,9 +29,9 @@ do
run_test || test_fail
check_chronyd_exit || test_fail
check_packet_port || test_fail
check_packet_interval || test_fail
# These checks are expected to fail
check_source_selection && test_fail
check_packet_interval && test_fail
check_sync && test_fail
done

View file

@ -18,7 +18,7 @@ export PATH=../../:$PATH
export CLKNETSIM_PATH=clknetsim
# Known working clknetsim revision
clknetsim_revision=8a7f9e753b0548e78ef3ef750da547a54d405bde
clknetsim_revision=6647b1e11cf715676361c0fb449a23ade82947b9
clknetsim_url=https://github.com/mlichvar/clknetsim/archive/$clknetsim_revision.tar.gz
# Only Linux is supported
@ -281,12 +281,12 @@ check_packet_interval() {
# incoming is not longer than outgoing for stratum 1 servers, and
# outgoing is not longer than incoming for clients.
nodes=$[$servers * $server_strata + $clients]
check_stat $in_interval 0.1 $limit && \
check_stat $out_interval 0.1 $limit && \
check_stat $in_interval 0.1 inf && \
check_stat $out_interval 0.1 inf && \
([ $i -gt $servers ] || \
check_stat $in_interval 0.0 $out_interval) && \
([ $i -le $[$servers * $server_strata] ] || \
check_stat $in_interval 0.0 $out_interval) && \
check_stat $out_interval 0.0 $in_interval) && \
test_ok || test_bad
[ $? -eq 0 ] || ret=1