"maxdelay $server 1e-1" \
"maxdelaydevratio $server 5.0" \
"maxdelayratio $server 3.0" \
- "maxpoll $server 5" \
+ "maxpoll $server 12" \
"maxupdateskew $server 10.0" \
- "minpoll $server 3" \
+ "minpoll $server 10" \
"minstratum $server 1" \
"offline" \
"online" \
run_chronyc "clients" || test_fail
check_chronyc_output "^Hostname NTP Drop Int IntL Last Cmd Drop Int Last
===============================================================================
-127\.0\.0\.1 [0-9 ]+ 0 [-0-9 ]+ - [0-9] 0 0 - -$" \
+127\.0\.0\.1 [0-9 ]+ 0 [-0-9 ]+ - [ 0-9]+ 0 0 - -$" \
|| test_fail
run_chronyc "ntpdata $server" || test_fail
Version : 4
Mode : Server
Stratum : 10
-Poll interval : (-6|[0345]) \([0-9]+ seconds\)
+Poll interval : (-6|[0-9]+) \([0-9]+ seconds\)
Precision : [0-9 +-]+ \(0\.[0-9]+ seconds\)
Root delay : 0\.000000 seconds
Root dispersion : 0\.000000 seconds
echo "server 127.123.5.3" > $TEST_DIR/conf5.d/3.sources
start_chronyd || test_fail
-wait_for_sync || test_fail
run_chronyc "sources" || test_fail
check_chronyc_output "^[^=]*
.. 127\.123\.2\.2 [^^]*
.. 127\.123\.2\.3 [^^]*
.. 127\.123\.4\.4 [^^]*
-.. 127\.123\.1\.2 *0 6 [^^]*
-.. 127\.123\.5\.2 *0 7 [^^]*
+.. 127\.123\.1\.2 *[05] 6 [^^]*
+.. 127\.123\.5\.2 *[05] 7 [^^]*
.. 127\.123\.5\.4 [^^]*$" || test_fail
stop_chronyd || test_fail
ntsprocesses 3"
start_chronyd || test_fail
-sleep 3
+wait_for_sync || test_fail
run_chronyc "authdata" || test_fail
check_chronyc_output "^Name/IP address Mode KeyID Type KLen Last Atmp NAK Cook CLen
server_options="port $ntpport nts ntsport $((ntsport + 1))"
start_chronyd || test_fail
-sleep 2
+wait_for_sync || test_fail
run_chronyc "authdata" || test_fail
check_chronyc_output "^Name/IP address Mode KeyID Type KLen Last Atmp NAK Cook CLen
}
wait_for_sync() {
+ local prev_length
+
test_message 1 0 "waiting for synchronization"
- sleep 1 && test_ok || test_error
+ prev_length=$msg_length
+
+ for i in $(seq 1 10); do
+ run_chronyc "ntpdata $server" > /dev/null 2>&1 || break
+ if check_chronyc_output "Total RX +: [1-9]" > /dev/null 2>&1; then
+ msg_length=$prev_length
+ test_ok
+ return
+ fi
+ sleep 1
+ done
+
+ msg_length=$prev_length
+ test_error
}
# Stop the chronyd instance