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.
#!/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 }"
-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