reference: make local reference timestamp consistent

In the local reference mode, instead of returning the adjusted current
time as the reference time, return the same timestamp updated only once
per about 62.5 seconds.

This will enable chronyd to detect polling of itself even when the local
reference mode is active.
This commit is contained in:
Miroslav Lichvar
2019-09-05 17:14:30 +02:00
parent 9ef7ea2bcb
commit 64e21d6281
2 changed files with 19 additions and 11 deletions

View File

@@ -15,11 +15,10 @@ chronyc_start="1.5"
chronyc_conf="tracking"
for year in `seq 1850 100 2300`; do
date="Jan 01 00:00:00 $year"
export CLKNETSIM_START_DATE=$(date -d "$date UTC" +'%s')
export CLKNETSIM_START_DATE=$(date -d "Jan 01 00:00:05 $year UTC" +'%s')
run_test || test_fail
check_chronyd_exit || test_fail
check_chronyc_output "^.*Ref time \(UTC\).*$date.*$" || test_fail
check_chronyc_output "^.*Ref time \(UTC\).*Jan 01 00:00:0. $year.*$" || test_fail
done
test_pass