Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:nkrapp:branches:Base:System
dracut
TEST-60-BONDBRIDGEVLANIFCFG-V59-openQA.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File TEST-60-BONDBRIDGEVLANIFCFG-V59-openQA.patch of Package dracut
From c6415191964de896c601994de19c9da8a04c28a7 Mon Sep 17 00:00:00 2001 From: nkrapp <nico.krapp@suse.com> Date: Mon, 8 May 2023 14:31:29 +0200 Subject: [PATCH] Patch TEST-60 TEST-60 use predictable network interface names --- .../client-init.sh | 7 ++-- .../server-init.sh | 32 +++++++++------ test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh | 41 +++++++++++++------ .../wait-if-server.sh | 8 ++-- 4 files changed, 56 insertions(+), 32 deletions(-) diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh index 644308d134..02f4f4a9f3 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh @@ -11,10 +11,9 @@ echo "made it to the rootfs! Powering down." ( echo OK ip -o -4 address show scope global | while read -r _ if rest; do echo "$if"; done | sort - for i in /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-*; do - echo "$i" - grep -v 'UUID=' "$i" - done + if ! $(grep -q NetworkManager /proc/cmdline); then + ip -o -4 route show all | sort + fi echo EOF ) | dd oflag=direct,dsync of=/dev/sda diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh index ea06b787e0..dae6ce4608 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh @@ -54,20 +54,22 @@ udevadm settle ip link show -wait_for_if_link enx525401123456 -wait_for_if_link enx525401123457 -wait_for_if_link enx525401123458 -wait_for_if_link enx525401123459 +wait_for_if_link enp0s2 +wait_for_if_link enp0s3 +wait_for_if_link enp0s4 +wait_for_if_link enp0s5 -ip link set dev enx525401123456 name net1 -ip link set dev enx525401123457 name net2 -ip link set dev enx525401123458 name net3 -ip link set dev enx525401123459 name net4 +ip link set dev enp0s2 name net1 +ip link set dev enp0s3 name net2 +ip link set dev enp0s4 name net3 +ip link set dev enp0s5 name net4 modprobe --all -b -q 8021q ipvlan macvlan : > /dev/watchdog ip addr add 127.0.0.1/8 dev lo linkup lo +ip addr add 192.168.51.1/24 dev net3 +linkup net3 ip addr add 192.168.50.1/24 dev net1 linkup net1 : > /dev/watchdog @@ -84,9 +86,10 @@ ip link set dev net2.1 up ip link set dev net2.2 up ip link set dev net2.3 up ip link set dev net2.4 up -ip addr add 192.168.51.1/24 dev net3 -linkup net3 linkup net4 + +wait_for_route_ok + : > /dev/watchdog modprobe af_packet : > /dev/watchdog @@ -117,11 +120,16 @@ exportfs -r : > /dev/watchdog chmod 777 /var/lib/dhcpd/dhcpd.leases : > /dev/watchdog -dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases net1 net3 + +dhcpd -f -d -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases net1 net3 & + +sleep 10 + #echo -n 'V' : > /dev/watchdog #sh -i -#tcpdump -i net1 +tcpdump -i net3 & # Wait forever for the VM to die + echo "Serving" while :; do sleep 10 diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh index 12afca94f6..760ffcc867 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh @@ -9,6 +9,8 @@ TEST_DESCRIPTION="root filesystem on NFS with bridging/bonding/vlan with $USE_NE KVERSION=${KVERSION-$(uname -r)} +export basedir=/usr/lib/dracut + # Uncomment this to debug failures #DEBUGFAIL="rd.shell rd.break" #DEBUGFAIL="rd.shell rd.break rd.debug" @@ -30,7 +32,7 @@ run_server() { -hda "$TESTDIR"/server.ext3 \ -serial "${SERIAL:-"file:$TESTDIR/server.log"}" \ -device i6300esb -watchdog-action poweroff \ - -append "panic=1 oops=panic softlockup_panic=1 loglevel=7 root=LABEL=dracut rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ + -append "nompath panic=1 oops=panic softlockup_panic=1 loglevel=7 root=LABEL=dracut rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 chmod 644 -- "$TESTDIR"/server.pid || return 1 @@ -86,19 +88,20 @@ client_test() { -hda "$TESTDIR"/client.img \ -device i6300esb -watchdog-action poweroff \ -append " - panic=1 oops=panic softlockup_panic=1 + nompath panic=1 oops=panic softlockup_panic=1 ifname=net1:52:54:00:12:34:01 ifname=net2:52:54:00:12:34:02 ifname=net3:52:54:00:12:34:03 ifname=net4:52:54:00:12:34:04 ifname=net5:52:54:00:12:34:05 - $cmdline rd.net.timeout.dhcp=3 systemd.crash_reboot rd.debug + $cmdline rd.net.dhcp.retry=3 rd.net.timeout.dhcp=5 systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing || return 1 { read -r OK _ if [[ $OK != "OK" ]]; then + cp "$TESTDIR"/server.log /tmp/dracut-testsuite-logs/ echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" return 1 fi @@ -110,6 +113,7 @@ client_test() { } < "$TESTDIR"/client.img || return 1 if [[ $check != "$CONF" ]]; then + cp "$TESTDIR"/server.log /tmp/dracut-testsuite-logs/ echo "Expected: '$check'" echo echo @@ -127,6 +131,14 @@ test_run() { echo "Failed to start server" 1>&2 return 1 fi + sleep 10 + + TESTNAME=$(basename $(pwd)) + for file in $(ls $TESTDIR); do + [[ $file = *.img ]] && continue + cp -v $TESTDIR/$file /tmp/dracut-testsuite-logs/$TESTNAME-$file + done + test_client || { kill_server return 1 @@ -135,11 +147,11 @@ test_run() { test_client() { if [[ $NM ]]; then - EXPECT='net1 net3.0004 net3.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-* EOF ' + EXPECT='net1 net3.0004 net3.3 vlan0001 vlan2 EOF ' + NM_BOOT_PARAM="NetworkManager" else - EXPECT='net1 net3.0004 net3.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net1 # Generated by dracut initrd NAME="net1" HWADDR="52:54:00:12:34:01" DEVICE="net1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net3.0004 # Generated by dracut initrd NAME="net3.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="net3.0004" VLAN=yes PHYSDEV="net3" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net3.3 # Generated by dracut initrd NAME="net3.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="net3.3" VLAN=yes PHYSDEV="net3" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan0001 # Generated by dracut initrd NAME="vlan0001" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.54.101" PREFIX="24" GATEWAY="192.168.54.1" TYPE=Vlan DEVICE="vlan0001" VLAN=yes PHYSDEV="net3" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan2 # Generated by dracut initrd NAME="vlan2" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.55.102" PREFIX="24" GATEWAY="192.168.55.1" TYPE=Vlan DEVICE="vlan2" VLAN=yes PHYSDEV="net3" EOF ' + EXPECT='net1 net3.0004 net3.3 vlan0001 vlan2 default via 192.168.55.1 dev vlan2 EOF ' fi - client_test "Multiple VLAN" \ "yes" \ " @@ -154,16 +166,17 @@ ip=192.168.56.103::192.168.56.1:24:test:net3.3:none ip=192.168.57.104::192.168.57.1:24:test:net3.0004:none rd.neednet=1 root=nfs:192.168.50.1:/nfs/client bootdev=net1 +$NM_BOOT_PARAM " \ "$EXPECT" \ || return 1 if [[ $NM ]]; then - EXPECT='bond0 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-* EOF ' + EXPECT='bond0 bond1 EOF ' + NM_BOOT_PARAM="NetworkManager" else - EXPECT='bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond0 # Generated by dracut initrd NAME="bond0" DEVICE="bond0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond0" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond1 # Generated by dracut initrd NAME="bond1" DEVICE="bond1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond1" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net1 # Generated by dracut initrd NAME="net1" HWADDR="52:54:00:12:34:01" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="net1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net2 # Generated by dracut initrd NAME="net2" HWADDR="52:54:00:12:34:02" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="net2" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net4 # Generated by dracut initrd NAME="net4" HWADDR="52:54:00:12:34:04" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="net4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net5 # Generated by dracut initrd NAME="net5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="net5" EOF ' + EXPECT='bond0 bond1 default via 192.168.50.1 dev bond0 EOF ' fi fi - client_test "Multiple Bonds" \ "yes" \ " @@ -173,14 +186,16 @@ ip=bond0:dhcp ip=bond1:dhcp rd.neednet=1 root=nfs:192.168.50.1:/nfs/client bootdev=bond0 +$NM_BOOT_PARAM " \ "$EXPECT" \ || return 1 if [[ $NM ]]; then - EXPECT='br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-* EOF ' + EXPECT='br0 br1 EOF ' + NM_BOOT_PARAM="NetworkManager" else - EXPECT='br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net1 # Generated by dracut initrd NAME="net1" HWADDR="52:54:00:12:34:01" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="net1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net2 # Generated by dracut initrd NAME="net2" HWADDR="52:54:00:12:34:02" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="net2" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net4 # Generated by dracut initrd NAME="net4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="net4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-net5 # Generated by dracut initrd NAME="net5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="net5" EOF ' + EXPECT='br0 br1 default via 192.168.50.1 dev br0 EOF ' fi client_test "Multiple Bridges" \ @@ -192,6 +207,7 @@ ip=br0:dhcp ip=br1:dhcp rd.neednet=1 root=nfs:192.168.50.1:/nfs/client bootdev=br0 +$NM_BOOT_PARAM " \ "$EXPECT" \ || return 1 @@ -337,6 +353,7 @@ test_setup() { "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ -m "bash rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ + -o "systemd-initrd systemd" \ --nomdadmconf \ --no-hostonly-cmdline -N \ -f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1 @@ -397,4 +414,4 @@ test_cleanup() { } # shellcheck disable=SC1090 -. "$testdir"/test-functions +. "$basedir"/test/test-functions diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/wait-if-server.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/wait-if-server.sh index 7cdb941780..c7ece86b06 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/wait-if-server.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/wait-if-server.sh @@ -1,6 +1,6 @@ #!/bin/sh . /lib/net-lib.sh -wait_for_if_link enx525401123456 -wait_for_if_link enx525401123457 -wait_for_if_link enx525401123458 -wait_for_if_link enx525401123459 +wait_for_if_link enp0s2 +wait_for_if_link enp0s3 +wait_for_if_link enp0s4 +wait_for_if_link enp0s5
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor