mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 15:15:07 -05:00
test: add 014-intermittent test
This commit is contained in:
49
test/simulation/014-intermittent
Executable file
49
test/simulation/014-intermittent
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
. ./test.common
|
||||||
|
|
||||||
|
test_start "intermittent connection"
|
||||||
|
|
||||||
|
# Pass packets only for 1200 seconds every 10000 seconds
|
||||||
|
base_delay=$(cat <<-EOF | tr -d '\n'
|
||||||
|
(+ 1e-4
|
||||||
|
(* -1
|
||||||
|
(equal 0.1 (min (% time 10000) 1200) 1200)))
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
time_max_limit=1e-1
|
||||||
|
freq_max_limit=1e-2
|
||||||
|
time_rms_limit=2e-3
|
||||||
|
freq_rms_limit=2e-5
|
||||||
|
limit=100000
|
||||||
|
|
||||||
|
run_test || test_fail
|
||||||
|
check_chronyd_exit || test_fail
|
||||||
|
check_sync || test_fail
|
||||||
|
|
||||||
|
check_log_messages "Can't.*no selectable sources" 9 10 || test_fail
|
||||||
|
check_log_messages "Selected source 192.168.123.1" 9 10 || test_fail
|
||||||
|
|
||||||
|
# Pass every 20th request
|
||||||
|
base_delay=$(cat <<-EOF | tr -d '\n'
|
||||||
|
(+ 1e-4
|
||||||
|
(* -1
|
||||||
|
(equal 0.1 from 2)
|
||||||
|
(equal 0.1 (min (% (sum 1) 20) 1) 1)))
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
time_max_limit=1e-2
|
||||||
|
freq_max_limit=1e-4
|
||||||
|
time_rms_limit=5e-3
|
||||||
|
max_sync_time=22000
|
||||||
|
|
||||||
|
run_test || test_fail
|
||||||
|
check_chronyd_exit || test_fail
|
||||||
|
check_sync || test_fail
|
||||||
|
|
||||||
|
check_log_messages "Can't.*no selectable sources" 5 15 || test_fail
|
||||||
|
check_log_messages "Selected source 192.168.123.1" 5 15 || test_fail
|
||||||
|
|
||||||
|
test_pass
|
||||||
Reference in New Issue
Block a user