]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-fstab-generator: skip test impacted by /mnt symlink 29711/head
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 25 Oct 2023 16:52:11 +0000 (17:52 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 26 Oct 2023 13:46:15 +0000 (14:46 +0100)
On rpm-ostree distributions such as Fedora SilverBlue /mnt
(and other well known paths) will be a symlink to a location
under /var. The fstab generator emits correct output in this
case, however, the data does not match the expected output
stored in the source tree.

Rather than trying to adapt the test data, just skip this
single test scenario when we see /mnt is a symlink.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
test/test-fstab-generator.sh

index 50ba321b9c855afcd50bf2040a7ed05df16fa259..af8fa7c226d576a4305aac9b893ed383d82ba652 100755 (executable)
@@ -128,6 +128,14 @@ test_one() (
 )
 
 for f in "$src"/test-*.input; do
+    # If /mnt is a symlink, then the expected output from this
+    # test scenario will not match the actual output
+    if test "$f" = "$src/test-18-options.fstab.input" -a "$(readlink /mnt)" != "/mnt"
+    then
+        echo "Skip $f because /mnt is a symlink"
+        continue
+    fi
+
     test_one "$f" yes
     test_one "$f" no
 done