summaryrefslogtreecommitdiff
path: root/tests/fake_apk_test
blob: 8dd140bbed52a816d90fa16b61e5ca8a2bdfe846 (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
#!/usr/bin/env atf-sh

. $(atf_get_srcdir)/test_env.sh
init_tests \
	fake_apk_add

fake_apk_add_body() {
	init_env
	atf_check -s exit:0 \
		-o match:"DEBUG: fake apk" \
		apk add linux-rpi

	test -f boot/vmlinuz-rpi || atf_fail "boot/vmlinuz-rpi was not created"

	atf_check -s exit:0 \
		-o match:"DEBUG: fake apk" \
		apk add linux-firmware

	atf_check \
		-o match:"lib/firmware" \
		-o match:"lib/modules" \
		find
}

fake_apk_audit_body() {
	init_env
	atf_check -s exit:0 \
		-o no-match:"DEBUG: fake apk" \
		-o match:"U etc/hostname" \
		apk audit

	atf_check -s exit:0 \
		-o no-match:"DEBUG: fake apk" \
		-o match:"etc/hostname" \
		apk audit --quiet
}