chrony/test/system/100-clockupdate
Miroslav Lichvar 86a99bb257 test: use env in shebang of system tests
This should allow the tests to run on systems where bash is not in /bin.
2019-04-26 10:54:02 +02:00

30 lines
750 B
Bash
Executable file

#!/usr/bin/env bash
. ./test.common
test_start "update of system clock"
clock_control=1
minimal_config=1
start_chronyd || test_fail
run_chronyc "dfreq 1e-3" || test_fail
check_chronyc_output "200 OK" || test_fail
before=$(date '+%s')
run_chronyc "doffset -1.0" || test_fail
check_chronyc_output "200 OK" || test_fail
run_chronyc "makestep" || test_fail
check_chronyc_output "200 OK" || test_fail
after=$(date '+%s')
test_message 1 0 "checking system clock"
[ "$before" -lt "$after" ] && test_ok || test_bad || test_fail
run_chronyc "doffset 1.0" || test_fail
run_chronyc "makestep" || test_fail
stop_chronyd || test_fail
check_chronyd_messages || test_fail
check_chronyd_message_count "System clock was stepped by" 2 2 || test_fail
test_pass