]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test(SYSTEMD): make the man command succeed
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Thu, 18 Aug 2022 01:25:38 +0000 (01:25 +0000)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Thu, 29 Sep 2022 05:45:47 +0000 (05:45 +0000)
Document the reason of the existing workaround.

Move the existing logic to the initramfs.testing generation phase
and make the steps more generic.

This change makes the test pass on debian.

test/TEST-02-SYSTEMD/systemd-analyze.sh
test/TEST-02-SYSTEMD/test.sh

index 5127b641352813474592c0d7b522b8b5c3f4aa36..55f872843d67f0a94a12057ad78f89c976d9ab94 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-cp /usr/bin/true /usr/bin/man
-
 for i in \
     sysinit.target \
     basic.target \
index 796f74873c6acc41f55fca5b7f67f90c5625f7a6..64b135ba410bf492c3160a0fcf1627678e75c51e 100755 (executable)
@@ -102,9 +102,15 @@ test_setup() {
         export initdir=$TESTDIR/overlay
         # shellcheck disable=SC1090
         . "$basedir"/dracut-init.sh
-        inst_multiple poweroff shutdown dd
+        inst_multiple poweroff shutdown dd true
+
         inst_hook shutdown-emergency 000 ./hard-off.sh
+
+        # systemd-analyze.sh calls man indirectly
+        # make the man command succeed always
+        inst "$(find_binary true)" "/usr/bin/man"
         inst_hook pre-pivot 000 ./systemd-analyze.sh
+
         inst_hook emergency 000 ./hard-off.sh
     )
     "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \