-
Notifications
You must be signed in to change notification settings - Fork 155
/
test.sh
executable file
·47 lines (38 loc) · 1.1 KB
/
test.sh
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
#!/bin/bash
# kola: {"platforms": "qemu", "minMemory": 4096, "architectures": "!s390x"}
set -xeuo pipefail
ok() {
echo "ok" "$@"
}
fatal() {
echo "$@" >&2
exit 1
}
srcdev=$(findmnt -nvr / -o SOURCE)
[[ ${srcdev} == /dev/mapper/myluksdev ]]
blktype=$(lsblk -o TYPE "${srcdev}" --noheadings)
[[ ${blktype} == crypt ]]
fstype=$(findmnt -nvr / -o FSTYPE)
[[ ${fstype} == xfs ]]
ok "source is XFS on LUKS device"
rootflags=$(findmnt /sysroot -no OPTIONS)
if ! grep prjquota <<< "${rootflags}"; then
fatal "missing prjquota in root mount flags: ${rootflags}"
fi
ok "root mounted with prjquota"
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
# check that ignition-ostree-growfs ran
if [ ! -e /run/ignition-ostree-growfs.stamp ]; then
fatal "ignition-ostree-growfs did not run"
fi
# reboot once to sanity-check we can find root on second boot
/tmp/autopkgtest-reboot rebooted
;;
rebooted)
grep root=UUID= /proc/cmdline
grep rd.luks.name= /proc/cmdline
ok "found root kargs"
;;
*) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";;
esac