]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test: include debug module in server only when debugging
authorBenjamin Drung <benjamin.drung@canonical.com>
Fri, 15 Nov 2024 22:26:29 +0000 (23:26 +0100)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 16 Nov 2024 02:50:43 +0000 (21:50 -0500)
Including the `debug` module in the server's dracut image is not needed
for the normal test case run. Only include it when the user sets
`SERVER_DEBUG` to debug the test case.

test/TEST-60-NFS/test.sh
test/TEST-61-MULTINIC/test.sh
test/TEST-62-BONDBRIDGEVLAN/test.sh
test/TEST-71-ISCSI-MULTI/test.sh
test/TEST-72-NBD/test.sh

index f2eb5bf26f60e5f7d3a3ca8a5df124d876fbbcf0..27034da770ebdfc79cc597defe36ee6985872de8 100755 (executable)
@@ -421,7 +421,7 @@ test_setup() {
     )
     # Make server's dracut image
     "$DRACUT" -i "$TESTDIR"/overlay / \
-        -a "bash rootfs-block debug kernel-modules watchdog qemu network-legacy" \
+        -a "bash rootfs-block kernel-modules watchdog qemu network-legacy ${SERVER_DEBUG:+debug}" \
         -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod i6300esb virtio_net" \
         --no-hostonly-cmdline -N \
         -f "$TESTDIR"/initramfs.server "$KVERSION" || return 1
index 820324f904d232229dc88e9a416e665b07757619..b424d8152bb20b8ad4e9e0ea3e3aa94b7f9f9ee0 100755 (executable)
@@ -5,6 +5,7 @@ TEST_DESCRIPTION="root filesystem on NFS with multiple nics with $USE_NETWORK"
 
 # Uncomment this to debug failures
 #DEBUGFAIL="loglevel=7 rd.shell rd.break"
+#SERVER_DEBUG="rd.debug loglevel=7"
 #SERIAL="tcp:127.0.0.1:9999"
 
 # skip the test if ifcfg dracut module can not be installed
@@ -31,7 +32,7 @@ run_server() {
         -net socket,listen=127.0.0.1:12350 \
         -net nic,macaddr=52:54:01:12:34:56,model=virtio \
         -serial "${SERIAL:-"file:$TESTDIR/server.log"}" \
-        -append "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot root=LABEL=dracut rootfstype=ext4 rw console=ttyS0,115200n81" \
+        -append "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot root=LABEL=dracut rootfstype=ext4 rw console=ttyS0,115200n81 $SERVER_DEBUG" \
         -initrd "$TESTDIR"/initramfs.server \
         -pidfile "$TESTDIR"/server.pid -daemonize || return 1
 
@@ -353,7 +354,7 @@ test_setup() {
     )
     # Make server's dracut image
     "$DRACUT" -i "$TESTDIR"/overlay / \
-        -m "bash rootfs-block debug kernel-modules watchdog qemu network-legacy" \
+        -m "bash rootfs-block kernel-modules watchdog qemu network-legacy ${SERVER_DEBUG:+debug}" \
         -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd i6300esb virtio_net" \
         --no-hostonly-cmdline -N \
         -f "$TESTDIR"/initramfs.server "$KVERSION" || return 1
index 0c08f9dcfcaef795e4684b953fe1dc81c276e262..7b9bad76480c99c600d5576bf8f75fa681872bd6 100755 (executable)
@@ -7,6 +7,7 @@ TEST_DESCRIPTION="root filesystem on NFS with bridging/bonding/vlan with $USE_NE
 
 # Uncomment this to debug failures
 #DEBUGFAIL="rd.shell rd.break"
+#SERVER_DEBUG="rd.debug loglevel=7"
 #SERIAL="tcp:127.0.0.1:9999"
 
 # skip the test if ifcfg dracut module can not be installed
@@ -373,7 +374,7 @@ test_setup() {
     # Make client's dracut image
     test_dracut \
         --no-hostonly --no-hostonly-cmdline \
-        -a "debug ${USE_NETWORK} ifcfg" \
+        -a "${USE_NETWORK} ifcfg ${DEBUGFAIL:+debug}" \
         "$TESTDIR"/initramfs.testing
 
     (
@@ -388,7 +389,7 @@ test_setup() {
     # Make server's dracut image
     "$DRACUT" -i "$TESTDIR"/overlay / \
         --no-early-microcode \
-        -m "rootfs-block debug kernel-modules watchdog qemu network network-legacy" \
+        -m "rootfs-block kernel-modules watchdog qemu network network-legacy ${SERVER_DEBUG:+debug}" \
         -d "ipvlan macvlan af_packet piix ide-gd_mod ata_piix ext4 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd virtio-net i6300esb" \
         --no-hostonly-cmdline -N \
         -f "$TESTDIR"/initramfs.server "$KVERSION" || return 1
index f556b87c9dc04115ba1b79736c7ac4d33783c8fc..df7680a9abda4bfdfe3fb9bed274d233facb2c6c 100755 (executable)
@@ -236,7 +236,7 @@ test_setup() {
 
     # Make server's dracut image
     "$DRACUT" -i "$TESTDIR"/overlay / \
-        -a "test rootfs-block debug kernel-modules network-legacy" \
+        -a "test rootfs-block kernel-modules network-legacy ${SERVER_DEBUG:+debug}" \
         -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod drbg virtio_net" \
         -i "./server.link" "/etc/systemd/network/01-server.link" \
         -i "./wait-if-server.sh" "/lib/dracut/hooks/pre-mount/99-wait-if-server.sh" \
index 55d477b82c1180c8e024d38e4fc9078d2e981bc8..a33617f73c4608cbaaaf67cfc67e096c5915dc79 100755 (executable)
@@ -6,6 +6,7 @@ TEST_DESCRIPTION="root filesystem on NBD with $USE_NETWORK"
 # Uncomment this to debug failures
 # DEBUGFAIL="rd.debug systemd.log_target=console loglevel=7"
 #DEBUGFAIL="rd.shell rd.break rd.debug systemd.log_target=console loglevel=7 systemd.log_level=debug"
+#SERVER_DEBUG="rd.debug loglevel=7"
 #SERIAL="tcp:127.0.0.1:9999"
 
 test_check() {
@@ -343,7 +344,7 @@ test_setup() {
         "$TESTDIR"/initramfs.testing
 
     "$DRACUT" -N -i "$TESTDIR"/overlay / \
-        -a "test rootfs-block debug kernel-modules network-legacy" \
+        -a "test rootfs-block kernel-modules network-legacy ${SERVER_DEBUG:+debug}" \
         -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod drbg virtio_net" \
         -i "./server.link" "/etc/systemd/network/01-server.link" \
         -i "./wait-if-server.sh" "/lib/dracut/hooks/pre-mount/99-wait-if-server.sh" \