]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test: move dracut.conf.d conf dir for tests under $TESTDIR
authorJo Zzsi <jozzsicsataban@gmail.com>
Sun, 15 Sep 2024 22:05:46 +0000 (18:05 -0400)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Thu, 19 Sep 2024 18:46:14 +0000 (14:46 -0400)
This will ensure that the directory gets cleaned up after test run.

test/TEST-18-UEFI/test.sh
test/test-functions

index ee18c3e6cf80fb44404f65fc9690c892175ded94..01c965081f19a55a6a8caa7262cd60ba4d1b7002 100755 (executable)
@@ -41,11 +41,11 @@ test_setup() {
     mkdir -p "$TESTDIR"/dracut.*/initramfs/proc
     mksquashfs "$TESTDIR"/dracut.*/initramfs/ "$TESTDIR"/squashfs.img -quiet -no-progress
 
-    mkdir -p "$TESTDIR"/ESP/EFI/BOOT /tmp/dracut.conf.d
+    mkdir -p "$TESTDIR"/ESP/EFI/BOOT "$TESTDIR"/dracut.conf.d
 
     # test with the reference uki config when systemd is available
     if command -v systemctl &> /dev/null; then
-        cp "${basedir}/dracut.conf.d/50-uki-virt.conf.example" /tmp/dracut.conf.d/50-uki-virt.conf
+        cp "${basedir}/dracut.conf.d/50-uki-virt.conf.example" "$TESTDIR"/dracut.conf.d/50-uki-virt.conf
     fi
 
     if command -v ukify &> /dev/null; then
index 91e33c74a551c47d40fcf45b615cae9c781b312f..db2fdeb7c2c99b715b655b6f7998c0aa54fd65ce 100644 (file)
@@ -32,15 +32,15 @@ fi
 
 test_dracut() {
     # directory for test configurations and for the generated initrd (extracted)
-    mkdir -p /tmp/dracut.conf.d "$TESTDIR"/initrd
+    mkdir -p "$TESTDIR"/dracut.conf.d "$TESTDIR"/initrd
 
     # grab the distro configuration from the host and make it available for the tests
     if [ -d /usr/lib/dracut/dracut.conf.d ]; then
-        cp -a /usr/lib/dracut/dracut.conf.d /tmp/
+        cp -a /usr/lib/dracut/dracut.conf.d "$TESTDIR"/
     fi
 
-    # pick up configuration from /tmp/dracut.conf.d when running the tests
-    TEST_DRACUT_ARGS+=" --local --confdir /tmp/dracut.conf.d --add-confdir test --keep --tmpdir $TESTDIR/initrd --kver $KVERSION"
+    # pick up configuration from $TESTDIR/dracut.conf.d when running the tests
+    TEST_DRACUT_ARGS+=" --local --confdir $TESTDIR/dracut.conf.d --add-confdir test --keep --tmpdir $TESTDIR/initrd --kver $KVERSION"
 
     # include $TESTDIR"/overlay if exists
     if [ -d "$TESTDIR"/overlay ]; then