]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test: skip test 98 if dracut-util is not available
authorBenjamin Drung <benjamin.drung@canonical.com>
Wed, 16 Aug 2023 11:56:41 +0000 (13:56 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Wed, 16 Aug 2023 15:34:12 +0000 (11:34 -0400)
Building `dracut-util` requires the source code to be present and
prevents running the test against the installed system. Check that
`dracut-util` and rely on the test environment to build `dracut-util`
beforehand.

test/TEST-98-GETARG/test.sh

index 74a1bec5d5ce3f0e1f9ff14eff414d5c1a3627b7..8f628a2596d7235c57a68782201b11d5c4244531 100755 (executable)
@@ -7,11 +7,13 @@
 TEST_DESCRIPTION="dracut getarg command"
 
 test_check() {
-    return 0
+    if ! [[ -x "$PKGLIBDIR/dracut-util" ]]; then
+        echo "Test needs dracut-util... Skipping"
+        return 1
+    fi
 }
 
 test_setup() {
-    make -C "$basedir" dracut-util
     ln -sfnr "$PKGLIBDIR"/dracut-util "$TESTDIR"/dracut-getarg
     ln -sfnr "$PKGLIBDIR"/dracut-util "$TESTDIR"/dracut-getargs
     ln -sfnr "$PKGLIBDIR"/modules.d/99base/dracut-lib.sh "$TESTDIR"/dracut-lib.sh