]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: extend 009-sourceselection test
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 9 Jun 2025 10:07:50 +0000 (12:07 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 9 Jun 2025 10:08:51 +0000 (12:08 +0200)
test/simulation/009-sourceselection

index 139b6aa2f03b096571854b24916350d67c55830d..5a7b5a183dee7f3bde514b61367cef6226dfc639 100755 (executable)
@@ -43,4 +43,35 @@ check_chronyd_exit || test_fail
 check_source_selection || test_fail
 check_sync || test_fail
 
+# Sources with large distance should be ignored
+
+servers=1
+server_strata=2
+server_conf="maxclockerror 1000"
+jitter=1e-7
+base_delay="(* -1.0 (equal 0.1 (min time 600) 600) (equal 0.1 from 2) (equal 0.1 to 1))"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_packet_interval || test_fail
+check_source_selection && test_fail
+check_sync && test_fail
+
+check_log_messages "Root distance of 192\.168\.123\.2 exceeds maxdistance of 3\." 1 1 || test_fail
+
+# Sources with large jitter should be ignored
+
+server_strata=1
+server_conf=$default_server_conf
+server_step="(pulse 64 64)"
+base_delay=$default_base_delay
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_packet_interval || test_fail
+check_source_selection && test_fail
+check_sync && test_fail
+
+check_log_messages "Jitter of 192\.168\.123\.1 exceeds maxjitter of 1\." 1 1 || test_fail
+
 test_pass