From: Lennart Poettering Date: Thu, 13 Mar 2025 15:58:59 +0000 (+0100) Subject: ci: add test for new validatefs work X-Git-Tag: v258-rc1~983^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e003d18bbf5e9f55c08b25d80b138b3a98d5f26;p=thirdparty%2Fsystemd.git ci: add test for new validatefs work --- diff --git a/test/units/TEST-81-GENERATORS.fstab-generator.sh b/test/units/TEST-81-GENERATORS.fstab-generator.sh index 0c1b27eb1de..95eba8a9f63 100755 --- a/test/units/TEST-81-GENERATORS.fstab-generator.sh +++ b/test/units/TEST-81-GENERATORS.fstab-generator.sh @@ -46,6 +46,7 @@ FSTAB_GENERAL=( "/dev/test22 /initrd/mount ext2 defaults,x-systemd.rw-only,x-initrd.mount 0 1" "/dev/test23 /initrd/mount/nofail ext3 defaults,nofail,x-initrd.mount 0 1" "/dev/test24 /initrd/mount/deps ext4 x-initrd.mount,x-systemd.before=early.service,x-systemd.after=late.service 0 1" + "/dev/test25 /x-systemd.validatefs xfs x-systemd.validatefs 0 0" # Incomplete, but valid entries "/dev/incomplete1 /incomplete1" @@ -282,6 +283,9 @@ check_fstab_mount_units() { elif [[ "$opt" == x-systemd.growfs ]]; then service="$(systemd-escape --template=systemd-growfs@.service --path "$where")" link_endswith "$out_dir/${unit}.wants/$service" "/lib/systemd/system/systemd-growfs@.service" + elif [[ "$opt" == x-systemd.validatefs ]]; then + service="$(systemd-escape --template=systemd-validatefs@.service --path "$where")" + link_endswith "$out_dir/${unit}.wants/$service" "/lib/systemd/system/systemd-validatefs@.service" elif [[ "$opt" == bg ]] && [[ "$fstype" =~ ^(nfs|nfs4)$ ]]; then # We "convert" nfs bg mounts to fg, so we can do the job-control # ourselves diff --git a/test/units/TEST-87-AUX-UTILS-VM.validatefs.sh b/test/units/TEST-87-AUX-UTILS-VM.validatefs.sh new file mode 100755 index 00000000000..5b142e178ac --- /dev/null +++ b/test/units/TEST-87-AUX-UTILS-VM.validatefs.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +if ! command -v systemd-repart >/dev/null; then + echo "no systemd-repart" + return +fi + +if ! test -x /usr/lib/systemd/systemd-validatefs ; then + echo "no systemd-validatefs" + return +fi + +export SYSTEMD_LOG_LEVEL=debug +export PAGER=cat + +at_exit() { + set +e + rm -rf /tmp/validatefs-test/ + rm -f /var/tmp/validatefs-test.raw + systemd-dissect --umount --rmdir /tmp/validatefs-test.mount + umount /tmp/validatefs-test.fake + rmdir /tmp/validatefs-test.fake +} + +trap at_exit EXIT + +mkdir /tmp/validatefs-test +cat > /tmp/validatefs-test/validatefs-root.conf < /tmp/validatefs-test/validatefs-usr.conf < /tmp/validatefs-test/validatefs-home.conf < /tmp/validatefs-test/validatefs-esp.conf < /tmp/validatefs-test/validatefs-generic.conf <