]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test(NETWORK): do not set net.ifnames=0
authorJo Zzsi <jozzsicsataban@gmail.com>
Tue, 6 Jan 2026 01:43:48 +0000 (20:43 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Wed, 7 Jan 2026 13:49:41 +0000 (08:49 -0500)
Increase test coverage by letting CI test containers to decide
the value of net.ifnames.

Change the test expectation to handle both net.ifnames=0
and net.ifnames=1.

test/TEST-50-NETWORK/assertion.sh
test/TEST-50-NETWORK/test.sh

index 28efd9b6efd5b073d35ce0ce472f0d84242a86a6..b872f9b5bc14d196f634a1fad389ed87cc4b4500 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
-# Get the output of 'ip addr show eth0'
-ip_output=$(ip addr show eth0)
+# Get the output of 'ip addr show' and filter out lo interface
+ip_output=$(ip -o -4 addr show | grep -v ': lo')
 
 # Extract the line containing "inet"
 inet_line="${ip_output##*inet }"
index b9934d195af9de7fc49d3104b74dbe2841453a90..d21acef572a69c0e8cadd1d4a1c6a5938bc1428b 100755 (executable)
@@ -19,7 +19,7 @@ test_run() {
         -device "virtio-net-pci,netdev=lan0" \
         -netdev "user,id=lan0,net=10.0.2.0/24,dhcpstart=10.0.2.15" \
         "${disk_args[@]}" \
-        -append "root=LABEL=dracut $TEST_KERNEL_CMDLINE rd.neednet=1 net.ifnames=0" \
+        -append "root=LABEL=dracut $TEST_KERNEL_CMDLINE rd.neednet=1" \
         -initrd "$TESTDIR"/initramfs.testing
 
     test_marker_check