Add a new set of tests for testing basic functionality, starting chronyd with root privileges on the actual system instead of the simulator. Tests numbered in the 100-199 range are considered destructive and intended to be used only on machines dedicated for development or testing. They are started by the run script only with the -d option. They may adjust/step the system clock and other clocks, block the RTC, enable HW timestamping, create SHM segments, etc. Other tests should not interfere with the system and should work even when another NTP server/client is running.
69 lines
1.3 KiB
Bash
Executable file
69 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
. ./test.common
|
|
|
|
test_start "chronyc commands"
|
|
|
|
start_chronyd || test_fail
|
|
|
|
for command in \
|
|
"accheck 1.2.3.4" \
|
|
"delete $server" \
|
|
"add server $server" \
|
|
"deny" \
|
|
"allow" \
|
|
"burst 1/1" \
|
|
"clients" \
|
|
"cmdallow 1.2.3.4" \
|
|
"cmdaccheck 1.2.3.4" \
|
|
"cmddeny 1.2.3.4" \
|
|
"cyclelogs" \
|
|
"dfreq 1.0e-3" \
|
|
"doffset -0.1" \
|
|
"dump" \
|
|
"local off" \
|
|
"local" \
|
|
"manual on" \
|
|
"settime now" \
|
|
"manual delete 0" \
|
|
"settime now" \
|
|
"manual reset" \
|
|
"manual off" \
|
|
"maxdelay $server 1e-2" \
|
|
"maxdelaydevratio $server 5.0" \
|
|
"maxdelayratio $server 3.0" \
|
|
"maxpoll $server 5" \
|
|
"maxupdateskew $server 10.0" \
|
|
"minpoll $server 3" \
|
|
"minstratum $server 1" \
|
|
"ntpdata $server" \
|
|
"offline" \
|
|
"online" \
|
|
"onoffline" \
|
|
"polltarget $server 10" \
|
|
"refresh" \
|
|
"rekey" \
|
|
"reselect" \
|
|
"reselectdist 1e-3" \
|
|
"serverstats" \
|
|
"smoothtime reset" \
|
|
"smoothtime activate" \
|
|
"shutdown" \
|
|
; do
|
|
run_chronyc "$command" || test_fail
|
|
done
|
|
|
|
stop_chronyd || test_fail
|
|
check_chronyd_messages || test_fail
|
|
start_chronyd || test_fail
|
|
|
|
run_chronyc "makestep" && test_fail
|
|
check_chronyc_output "500 Failure" || test_fail
|
|
run_chronyc "trimrtc" && test_fail
|
|
check_chronyc_output "513 RTC driver not running" || test_fail
|
|
run_chronyc "writertc" && test_fail
|
|
check_chronyc_output "513 RTC driver not running" || test_fail
|
|
|
|
stop_chronyd || test_fail
|
|
|
|
test_pass
|