summaryrefslogtreecommitdiff
path: root/tests/setup_ntp_test
blob: 829423279292eaa36359558a2911cacccaa5f614 (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
#!/usr/bin/env atf-sh

. $(atf_get_srcdir)/test_env.sh
init_tests \
	setup_ntp_usage \
	setup_ntp_invalid \
	setup_ntp_busybox \
	setup_ntp_chrony \
	setup_ntp_openntpd

setup_ntp_usage_body() {
	test_usage setup-ntp
}

setup_ntp_invalid_body() {
	init_env
	atf_check -s exit:1 \
		-o empty \
		-e match:"is not a supported NTP client" \
		setup-ntp invalid
}

setup_ntp_busybox_body() {
	init_env
	atf_check -s exit:0 \
		-o match:"service ntpd added" \
		-o match:"Starting ntpd" \
		setup-ntp busybox
}

setup_ntp_chrony_body() {
	init_env
	atf_check -s exit:0 \
		-o match:"service chronyd added" \
		-o match:"Starting chronyd" \
		setup-ntp chrony
}

setup_ntp_openntpd_body() {
	init_env
	atf_check -s exit:0 \
		-o match:"service openntpd added" \
		-o match:"Starting openntpd" \
		setup-ntp openntpd
}