]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add missing file and improve options-missing test
authorKarel Zak <kzak@redhat.com>
Thu, 30 Nov 2023 09:25:45 +0000 (10:25 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 30 Nov 2023 11:57:08 +0000 (12:57 +0100)
* remove optional ID= field (not on systems without statx())
* add missing tests/expected/mount/special-missing-options
* make sure utab is created
* use udevadm settle to wait for systemd

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/mount/special-missing-options [new file with mode: 0644]
tests/ts/mount/special

diff --git a/tests/expected/mount/special-missing-options b/tests/expected/mount/special-missing-options
new file mode 100644 (file)
index 0000000..9ead324
--- /dev/null
@@ -0,0 +1 @@
+SRC=/foo TARGET=/mountpoint ROOT=/ OPTS=x-foo=123,x-bar=BAR
index 40517e71167e8846aac70ceb4a0d988ae0d5cfdc..e1351e41e18cb3ddf9035f700de8693adb80f551 100755 (executable)
@@ -56,8 +56,8 @@ ts_init_subtest "username"
 $TS_CMD_MOUNT -t mytest -ouser=name,abc /foo /bar &> $TS_OUTPUT
 ts_finalize_subtest
 
-ts_init_subtest "missing-options"
 
+ts_init_subtest "missing-options"
 cat > $MOUNTER <<EOF
 #!/bin/bash
 # This util-linux regression test component
@@ -65,14 +65,21 @@ cat > $MOUNTER <<EOF
 #
 $TS_CMD_MOUNT -t tmpfs -i "\$1" "\$2" -o x-foo=123
 EOF
+chmod +x $MOUNTER
 
 mountpoint="$TS_OUTDIR/mnt"
 mkdir -p "$mountpoint"
 export LIBMOUNT_UTAB=$TS_OUTDIR/utab
+rm -f $LIBMOUNT_UTAB
+> $LIBMOUNT_UTAB
+
 $TS_CMD_MOUNT -t mytest -o x-bar=BAR /foo "$mountpoint" &> $TS_OUTPUT
+udevadm settle
+
 cat "$LIBMOUNT_UTAB" \
        | grep "$mountpoint" \
        | sed -e "s|$mountpoint|/mountpoint|g" \
+             -e 's/ID=[[:digit:]]* //g' \
        &> $TS_OUTPUT
 $TS_CMD_UMOUNT "$mountpoint"
 unset LIBMOUNT_UTAB