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