summaryrefslogtreecommitdiff
path: root/test/system/007-cmdmon
blob: f705fb071e63be68b3a05ba7bae5853b48b7c318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env 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