-
Notifications
You must be signed in to change notification settings - Fork 158
/
test.sh
executable file
·52 lines (43 loc) · 1.49 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
48
49
50
51
52
#!/bin/bash
# kola: { "platforms": "qemu", "minMemory": 4096, "additionalDisks": ["5G", "5G"], "timeoutMin": 15 }
#
# - platforms: qemu
# - This test should pass everywhere if it passes anywhere.
# - additionalDisks is only supported on qemu.
# - minMemory: 4096
# - Root reprovisioning requires at least 4GiB of memory.
# - additionalDisks: ["5G", "5G"]
# - Linear RAID is setup on these disks.
# - timeoutMin: 15
# - This test includes a lot of disk I/O and needs a higher
# timeout value than the default.
set -xeuo pipefail
. $KOLA_EXT_DATA/commonlib.sh
srcdev=$(findmnt -nvr / -o SOURCE)
[[ ${srcdev} == $(realpath /dev/md/foobar) ]]
blktype=$(lsblk -o TYPE "${srcdev}" --noheadings)
[[ ${blktype} == linear ]]
fstype=$(findmnt -nvr / -o FSTYPE)
[[ ${fstype} == xfs ]]
ok "source is XFS on linear 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 didn't run
if [ -e /run/ignition-ostree-growfs.stamp ]; then
fatal "ignition-ostree-growfs ran"
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.md.uuid= /proc/cmdline
ok "found root kargs"
;;
*) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";;
esac