diff --git a/tests/kola/disks/growfs b/tests/kola/disks/growfs index 04b4cb27c4..3e0b1f0ba9 100755 --- a/tests/kola/disks/growfs +++ b/tests/kola/disks/growfs @@ -10,3 +10,8 @@ if [ ! -f /run/ignition-ostree-growfs.stamp ]; then fatal "rootfs was not grown on first boot" fi ok "rootfs grown on first boot" + +if [ -f /run/ignition-ostree-autosaved-xfs.stamp ]; then + fatal "unexpected autosaved XFS" +fi +ok "rootfs wasn't automatically reprovisioned" diff --git a/tests/kola/root-reprovision/autosave-xfs/data/commonlib.sh b/tests/kola/root-reprovision/autosave-xfs/data/commonlib.sh new file mode 120000 index 0000000000..b8dcbdca1a --- /dev/null +++ b/tests/kola/root-reprovision/autosave-xfs/data/commonlib.sh @@ -0,0 +1 @@ +../../../data/commonlib.sh \ No newline at end of file diff --git a/tests/kola/root-reprovision/autosave-xfs/test.sh b/tests/kola/root-reprovision/autosave-xfs/test.sh new file mode 100755 index 0000000000..b50ca2f0a1 --- /dev/null +++ b/tests/kola/root-reprovision/autosave-xfs/test.sh @@ -0,0 +1,26 @@ +#!/bin/bash +## kola: +## # This test reprovisions the rootfs automatically. +## tags: "platform-independent reprovision" +## # Trigger automatic XFS reprovisioning +## minDisk: 64 +## # Root reprovisioning requires at least 4GiB of memory. +## minMemory: 4096 +## # This test includes a lot of disk I/O and needs a higher +## # timeout value than the default. +## timeoutMin: 15 + +set -xeuo pipefail + +. $KOLA_EXT_DATA/commonlib.sh + +if [ ! -f /run/ignition-ostree-autosaved-xfs.stamp ]; then + fatal "expected autosaved XFS" +fi +ok "autosaved XFS on large disk" + +eval $(xfs_info / | grep -o 'agcount=[0-9]*') +if [ "$agcount" -gt 4 ]; then + fatal "expected agcount of at most 4, got ${agcount}" +fi +ok "low agcount on large disk" diff --git a/tests/kola/root-reprovision/linear/test.sh b/tests/kola/root-reprovision/linear/test.sh index 3aaa6c865b..83bad0d232 100755 --- a/tests/kola/root-reprovision/linear/test.sh +++ b/tests/kola/root-reprovision/linear/test.sh @@ -39,6 +39,11 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in fatal "ignition-ostree-growfs ran" fi + # check that autosave-xfs didn't run + if [ -e /run/ignition-ostree-autosaved-xfs.stamp ]; then + fatal "unexpected autosaved XFS" + fi + # reboot once to sanity-check we can find root on second boot /tmp/autopkgtest-reboot rebooted ;; diff --git a/tests/kola/root-reprovision/luks/autosave-xfs/config.ign b/tests/kola/root-reprovision/luks/autosave-xfs/config.ign new file mode 120000 index 0000000000..f72ce41f73 --- /dev/null +++ b/tests/kola/root-reprovision/luks/autosave-xfs/config.ign @@ -0,0 +1 @@ +../config.ign \ No newline at end of file diff --git a/tests/kola/root-reprovision/luks/autosave-xfs/data b/tests/kola/root-reprovision/luks/autosave-xfs/data new file mode 120000 index 0000000000..4909e06efb --- /dev/null +++ b/tests/kola/root-reprovision/luks/autosave-xfs/data @@ -0,0 +1 @@ +../data \ No newline at end of file diff --git a/tests/kola/root-reprovision/luks/autosave-xfs/test.sh b/tests/kola/root-reprovision/luks/autosave-xfs/test.sh new file mode 100755 index 0000000000..6625fad734 --- /dev/null +++ b/tests/kola/root-reprovision/luks/autosave-xfs/test.sh @@ -0,0 +1,34 @@ +#!/bin/bash +## kola: +## # This test reprovisions the rootfs. +## tags: "platform-independent reprovision" +## # Root reprovisioning requires at least 4GiB of memory. +## minMemory: 4096 +## # A TPM backend device is not available on s390x to suport TPM. +## architectures: "!s390x" +## # This test includes a lot of disk I/O and needs a higher +## # timeout value than the default. +## timeoutMin: 15 +## # Trigger automatic XFS reprovisioning +## minDisk: 64 + +set -xeuo pipefail + +. $KOLA_EXT_DATA/commonlib.sh + +# check that we ran automatic XFS reprovisioning +if [ -z "${AUTOPKGTEST_REBOOT_MARK:-}" ]; then + if [ ! -f /run/ignition-ostree-autosaved-xfs.stamp ]; then + fatal "expected autosaved XFS" + fi + ok "autosaved XFS on large disk" + + eval $(xfs_info / | grep -o 'agcount=[0-9]*') + if [ "$agcount" -gt 4 ]; then + fatal "expected agcount of at most 4, got ${agcount}" + fi + ok "low agcount on large disk" +fi + +# run the rest of the tests +. $KOLA_EXT_DATA/luks-test.sh diff --git a/tests/kola/root-reprovision/luks/test.sh b/tests/kola/root-reprovision/luks/test.sh index 25699f8f13..df70589032 100755 --- a/tests/kola/root-reprovision/luks/test.sh +++ b/tests/kola/root-reprovision/luks/test.sh @@ -14,6 +14,13 @@ set -xeuo pipefail . $KOLA_EXT_DATA/commonlib.sh +# check that we didn't run automatic XFS reprovisioning +if [ -z "${AUTOPKGTEST_REBOOT_MARK:-}" ]; then + if [ -f /run/ignition-ostree-autosaved-xfs.stamp ]; then + fatal "unexpected autosaved XFS" + fi + ok no autosaved XFS on large disk +fi -# run the tests +# run the rest of the tests . $KOLA_EXT_DATA/luks-test.sh diff --git a/tests/kola/root-reprovision/raid1/test.sh b/tests/kola/root-reprovision/raid1/test.sh index 15c15b3ca1..607c9877b0 100755 --- a/tests/kola/root-reprovision/raid1/test.sh +++ b/tests/kola/root-reprovision/raid1/test.sh @@ -39,6 +39,11 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in fatal "ignition-ostree-growfs ran" fi + # check that autosave-xfs didn't run + if [ -e /run/ignition-ostree-autosaved-xfs.stamp ]; then + fatal "unexpected autosaved XFS" + fi + # reboot once to sanity-check we can find root on second boot /tmp/autopkgtest-reboot rebooted ;;