-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add two basic tests: one where we reprovision in place to ext4, and one where we reprovision onto a separate RAID1.
- Loading branch information
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"ignition": { | ||
"version": "3.0.0" | ||
}, | ||
"storage": { | ||
"filesystems": [ | ||
{ | ||
"device": "/dev/disk/by-label/root", | ||
"wipeFilesystem": true, | ||
"format": "ext4", | ||
"label": "root" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# kola: {"platforms": "qemu", "minMemory": 4096} | ||
set -xeuo pipefail | ||
|
||
fstype=$(findmnt -nvr / -o FSTYPE) | ||
[[ $fstype == ext4 ]] | ||
|
||
case "${AUTOPKGTEST_REBOOT_MARK:-}" in | ||
"") | ||
# check that the partition was grown | ||
if [ ! -e /run/coreos-growpart.stamp ]; then | ||
echo "coreos-growpart did not run" | ||
exit 1 | ||
fi | ||
|
||
# reboot once to sanity-check we can find root on second boot | ||
/tmp/autopkgtest-reboot rebooted | ||
;; | ||
|
||
rebooted) | ||
grep root=UUID= /proc/cmdline | ||
;; | ||
*) echo "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}"; exit 1;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"ignition": { | ||
"version": "3.0.0" | ||
}, | ||
"storage": { | ||
"raid": [ | ||
{ | ||
"devices": [ | ||
"/dev/disk/by-id/virtio-disk1", | ||
"/dev/disk/by-id/virtio-disk2" | ||
], | ||
"level": "raid1", | ||
"name": "foobar" | ||
} | ||
], | ||
"filesystems": [ | ||
{ | ||
"device": "/dev/md/foobar", | ||
"format": "xfs", | ||
"wipeFilesystem": true, | ||
"label": "root" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# kola: {"platforms": "qemu", "minMemory": 4096, "additionalDisks": ["5G", "5G"]} | ||
set -xeuo pipefail | ||
|
||
srcdev=$(findmnt -nvr / -o SOURCE) | ||
[[ ${srcdev} == $(realpath /dev/md/foobar) ]] | ||
|
||
blktype=$(lsblk -o TYPE "${srcdev}" --noheadings) | ||
[[ ${blktype} == raid1 ]] | ||
|
||
fstype=$(findmnt -nvr / -o FSTYPE) | ||
[[ ${fstype} == xfs ]] | ||
|
||
case "${AUTOPKGTEST_REBOOT_MARK:-}" in | ||
"") | ||
# check that growpart didn't run | ||
if [ -e /run/coreos-growpart.stamp ]; then | ||
echo "coreos-growpart ran" | ||
exit 1 | ||
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 | ||
;; | ||
*) echo "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}"; exit 1;; | ||
esac |