]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test: allow running UEFI and kernel-install tests in chroot
authorBenjamin Drung <benjamin.drung@canonical.com>
Tue, 30 Sep 2025 12:50:20 +0000 (14:50 +0200)
committerLaszlo <laszlo.gombos@gmail.com>
Tue, 30 Sep 2025 13:51:13 +0000 (09:51 -0400)
The UEFI and kernel-install tests want to run in an isolated environment
to avoid modifying the host system. Allow running those tests in a
chroot (like schroot).

test/TEST-12-UEFI/test.sh
test/TEST-43-KERNEL-INSTALL/test.sh

index 5a8d79467d5eddd1ba6fb79e8260b765c0445333..047e105d8e0efc94b432b3a1fd885da240b37259 100755 (executable)
@@ -16,8 +16,8 @@ test_check() {
         return 1
     fi
 
-    if command -v systemd-detect-virt > /dev/null && ! systemd-detect-virt -c &> /dev/null; then
-        echo "This test assumes that it runs inside a CI container."
+    if command -v systemd-detect-virt > /dev/null && ! systemd-detect-virt -c &> /dev/null && ! systemd-detect-virt -r &> /dev/null; then
+        echo "This test assumes that it runs inside a chroot or CI container."
         return 1
     fi
 
index 19594b25a4cbae140c30ae4847f881da427f19ad..4aa0eec0eec76cd26b140aa8428cf3779704e497 100755 (executable)
@@ -4,8 +4,8 @@ set -eu
 TEST_DESCRIPTION="kernel-install with root filesystem on ext4 filesystem"
 
 test_check() {
-    if command -v systemd-detect-virt > /dev/null && ! systemd-detect-virt -c &> /dev/null; then
-        echo "This test assumes that it runs inside a CI container."
+    if command -v systemd-detect-virt > /dev/null && ! systemd-detect-virt -c &> /dev/null && ! systemd-detect-virt -r &> /dev/null; then
+        echo "This test assumes that it runs inside a chroot or CI container."
         return 1
     fi