mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:45:07 -05:00
Add maxunreach option to NTP sources and refclocks to specify the maximum number of polls that the source can stay selected for synchronization when it is unreachable (i.e. no valid sample was received in the last 8 polls). It is an additional requirement to having at least one sample more recent than the oldest sample of reachable sources. The default value is 100000. Setting the option to 0 disables selection of unreachable sources, which matches RFC 5905.
44 lines
1.1 KiB
Bash
Executable File
44 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
. ./test.common
|
|
|
|
test_start "maxunreach option"
|
|
|
|
limit=5000
|
|
servers=2
|
|
client_server_options="minpoll 6 maxpoll 6 minsamples 64"
|
|
base_delay=$(cat <<-EOF | tr -d '\n'
|
|
(+ 1e-4
|
|
(* -1
|
|
(equal 0.1 from 3)
|
|
(equal 0.1 to 1)
|
|
(equal 0.1 (min time 2000) 2000))
|
|
(* 0.5
|
|
(+ (equal 0.1 from 2)
|
|
(equal 0.1 to 2))))
|
|
EOF
|
|
)
|
|
|
|
run_test || test_fail
|
|
check_chronyd_exit || test_fail
|
|
check_source_selection || test_fail
|
|
check_packet_interval || test_fail
|
|
check_sync || test_fail
|
|
|
|
check_log_messages "Selected source 192.168.123.1" 1 1 || test_fail
|
|
check_log_messages "Selected source 192.168.123.2" 0 0 || test_fail
|
|
|
|
client_server_options="minpoll 6 maxpoll 6 minsamples 64 maxunreach 10"
|
|
|
|
run_test || test_fail
|
|
check_chronyd_exit || test_fail
|
|
check_source_selection || test_fail
|
|
check_packet_interval || test_fail
|
|
check_sync || test_fail
|
|
|
|
check_log_messages "Selected source 192.168.123.1" 1 1 || test_fail
|
|
check_log_messages "Selected source 192.168.123.2" 1 1 || test_fail
|
|
check_log_messages "00:52:..Z Selected source 192.168.123.2" 1 1 || test_fail
|
|
|
|
test_pass
|