]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: extend 106-refclock test
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 20 Apr 2021 15:43:20 +0000 (17:43 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 22 Apr 2021 08:20:31 +0000 (10:20 +0200)
test/simulation/106-refclock

index 0154fdbdbe949860c1b306210c3750a2851f6dea..c8ccb724a0d0c750aa9f757710c0458a3df6fef6 100755 (executable)
@@ -40,6 +40,7 @@ done
 if check_config_h 'FEAT_PPS 1'; then
        refclock_offset=0.35
        refclock_jitter=0.05
+
        client_conf="
 refclock SHM 0 refid NMEA noselect
 refclock PPS /dev/pps0 lock NMEA
@@ -59,6 +60,50 @@ Root delay      : 0\.000000001 seconds
        check_file_messages "20.* PPS1.*[0-9] N " 620 740 refclocks.log || test_fail
        check_file_messages "20.* PPS1.*- N " 60 63 refclocks.log || test_fail
        rm -f tmp/refclocks.log
+
+       client_conf="
+refclock SHM 0 noselect
+refclock PPS /dev/pps0
+local
+logdir tmp
+log refclocks"
+
+       run_test || test_fail
+       check_chronyd_exit || test_fail
+       check_source_selection || test_fail
+       check_sync || test_fail
+       check_chronyc_output "^Reference ID.*50505331 \(PPS1\)
+Stratum.*: 10
+.*
+Root delay      : 0\.000000001 seconds
+.*$" || test_fail
+
+       check_file_messages "20.* PPS1.*[0-9] N " 997 1001 refclocks.log || test_fail
+       check_file_messages "20.* PPS1.*- N " 60 63 refclocks.log || test_fail
+       rm -f tmp/refclocks.log
+
+       min_sync_time=100
+       max_sync_time=220
+       chronyc_start=220
+       client_conf="
+refclock SHM 0 refid NMEA offset 0.35 delay 0.1
+refclock PPS /dev/pps0
+logdir tmp
+log refclocks"
+
+       run_test || test_fail
+       check_chronyd_exit || test_fail
+       check_source_selection || test_fail
+       check_sync || test_fail
+       check_chronyc_output "^Reference ID.*50505331 \(PPS1\)
+Stratum.*: 1
+.*
+Root delay      : 0\.000000001 seconds
+.*$" || test_fail
+
+       check_file_messages "20.* PPS1.*[0-9] N " 800 940  refclocks.log || test_fail
+       check_file_messages "20.* PPS1.*- N " 50 63 refclocks.log || test_fail
+       rm -f tmp/refclocks.log
 fi
 
 test_pass