summaryrefslogtreecommitdiffstats
path: root/tests/sys/geom/class/eli/configure_test.sh
blob: da060e6119ea40d7c00902e622bd6332c31a52ca (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
# $FreeBSD$

atf_test_case configure_b_B cleanup
configure_b_B_head()
{
	atf_set "descr" "geli configure -b will set the BOOT flag"
	atf_set "require.user" "root"
}
configure_b_B_body()
{
	. $(atf_get_srcdir)/conf.sh

	sectors=100
	md=$(attach_md -t malloc -s `expr $sectors + 1`)

	atf_check geli init -B none -P -K /dev/null ${md}

	atf_check -s exit:0 -o match:'flags: 0x0$' geli dump ${md}

	atf_check geli init -B none -b -P -K /dev/null ${md}

	atf_check -s exit:0 -o match:'flags: 0x2$' geli dump ${md}

	atf_check geli configure -B ${md}

	atf_check -s exit:0 -o match:'flags: 0x0$' geli dump ${md}

	atf_check geli configure -b ${md}

	atf_check -s exit:0 -o match:'flags: 0x2$' geli dump ${md}

	atf_check geli attach -p -k /dev/null ${md}

	atf_check -s exit:0 -o match:'^Flags: .*BOOT' geli list ${md}.eli

	atf_check geli configure -B ${md}

	atf_check -o not-match:'^Flags: .*BOOT' geli list ${md}.eli

	atf_check -s exit:0 -o match:'flags: 0x0$' geli dump ${md}

	atf_check geli configure -b ${md}

	atf_check -s exit:0 -o match:'^Flags: .*BOOT' geli list ${md}.eli

	atf_check -s exit:0 -o match:'flags: 0x2$' geli dump ${md}

	atf_check geli detach ${md}
}
configure_b_B_cleanup()
{
	. $(atf_get_srcdir)/conf.sh
	geli_test_cleanup
}

atf_init_test_cases()
{
	atf_add_test_case configure_b_B
}
OpenPOWER on IntegriCloud