]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: extend 106-refclock test
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 18 Mar 2021 16:37:13 +0000 (17:37 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 18 Mar 2021 16:41:36 +0000 (17:41 +0100)
test/simulation/106-refclock

index ee1fd6679645732121f6a25cb3772395b660258e..0154fdbdbe949860c1b306210c3750a2851f6dea 100755 (executable)
@@ -16,7 +16,9 @@ chronyc_start=70
 chronyc_conf="tracking"
 
 for refclock in "SHM 0" "PHC /dev/ptp0"; do
-       client_conf="refclock $refclock stratum 3 delay 1e-3 refid GPS"
+       client_conf="refclock $refclock stratum 3 delay 1e-3 refid GPS
+logdir tmp
+log refclocks"
 
        run_test || test_fail
        check_chronyd_exit || test_fail
@@ -29,6 +31,34 @@ Root delay      : 0.001000000 seconds
 .*
 Update interval : 16\.. seconds
 .*$" || test_fail
+
+       check_file_messages "20.* GPS.*[0-9] N " 997 1001 refclocks.log || test_fail
+       check_file_messages "20.* GPS.*- N " 61 63 refclocks.log || test_fail
+       rm -f tmp/refclocks.log
 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
+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 " 620 740 refclocks.log || test_fail
+       check_file_messages "20.* PPS1.*- N " 60 63 refclocks.log || test_fail
+       rm -f tmp/refclocks.log
+fi
+
 test_pass