From 6058b06b86ce1a505a640c78896eae32768077c1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 13 Aug 2018 16:27:59 +0200 Subject: [PATCH] test/{TEST-50-MULTINIC,TEST-70-BONDBRIDGETEAMVLAN}: use qemu-3.0 syntax use qemu-3.0 syntax for network devices --- test/TEST-50-MULTINIC/test.sh | 20 +++++----- test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh | 4 ++ test/TEST-70-BONDBRIDGETEAMVLAN/test.sh | 53 ++++++++++++++------------ 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 7c108aa0..de40790f 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -51,15 +51,17 @@ client_test() { fi $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img -m 512M -smp 2 -nographic \ - -net socket,vlan=0,connect=127.0.0.1:12350 \ - -net nic,vlan=0,macaddr=52:54:00:12:34:$mac1,model=e1000 \ - -net nic,vlan=0,macaddr=52:54:00:12:34:$mac2,model=e1000 \ - -net nic,vlan=0,macaddr=52:54:00:12:34:$mac3,model=e1000 \ - -net nic,vlan=1,macaddr=52:54:00:12:34:98,model=e1000 \ - -net nic,vlan=2,macaddr=52:54:00:12:34:99,model=e1000 \ - -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ + -net socket,connect=127.0.0.1:12350 \ + -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ + -netdev hubport,id=n1,hubid=1 \ + -netdev hubport,id=n2,hubid=2 \ + --device e1000,netdev=n1,mac=52:54:00:12:34:98 \ + -device e1000,netdev=n2,mac=52:54:00:12:34:99 \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ + -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ -initrd "$TESTDIR"/initramfs.testing { read OK; read IFACES; } < "$TESTDIR"/client.img diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh index 562feae6..503ed9ed 100755 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh +++ b/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh @@ -67,6 +67,10 @@ ip addr add 192.168.55.1/24 dev ens4.2 ip addr add 192.168.56.1/24 dev ens4.3 ip addr add 192.168.57.1/24 dev ens4.4 linkup ens4 +ip link set dev ens4.1 up +ip link set dev ens4.2 up +ip link set dev ens4.3 up +ip link set dev ens4.4 up ip link set dev eth2 name ens5 ip addr add 192.168.51.1/24 dev ens5 linkup ens5 diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh index 277bbd01..eadf09f1 100755 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +++ b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh @@ -18,14 +18,14 @@ run_server() { -hda "$TESTDIR"/server.ext3 \ -m 512M -smp 2 \ -display none \ - -net socket,vlan=0,listen=127.0.0.1:12370 \ - -net socket,vlan=1,listen=127.0.0.1:12371 \ - -net socket,vlan=2,listen=127.0.0.1:12372 \ - -net socket,vlan=3,listen=127.0.0.1:12373 \ - -net nic,vlan=0,macaddr=52:54:01:12:34:56,model=e1000 \ - -net nic,vlan=1,macaddr=52:54:01:12:34:57,model=e1000 \ - -net nic,vlan=2,macaddr=52:54:01:12:34:58,model=e1000 \ - -net nic,vlan=3,macaddr=52:54:01:12:34:59,model=e1000 \ + -netdev socket,id=n0,listen=127.0.0.1:12370 \ + -netdev socket,id=n1,listen=127.0.0.1:12371 \ + -netdev socket,id=n2,listen=127.0.0.1:12372 \ + -netdev socket,id=n3,listen=127.0.0.1:12373 \ + -device e1000,netdev=n0,mac=52:54:01:12:34:56 \ + -device e1000,netdev=n1,mac=52:54:01:12:34:57 \ + -device e1000,netdev=n2,mac=52:54:01:12:34:58 \ + -device e1000,netdev=n3,mac=52:54:01:12:34:59 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ @@ -58,22 +58,25 @@ client_test() { echo "Unable to make client sda image" 1>&2 return 1 fi + if [[ $do_vlan13 ]]; then + nic1=" -netdev socket,connect=127.0.0.1:12371,id=n1" + nic3=" -netdev socket,connect=127.0.0.1:12373,id=n3" + else + nic1=" -netdev hubport,id=n1,hubid=2" + nic3=" -netdev hubport,id=n3,hubid=3" + fi $testdir/run-qemu -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ - -net socket,vlan=0,connect=127.0.0.1:12370 \ - ${do_vlan13:+-net socket,vlan=1,connect=127.0.0.1:12371} \ - -net socket,vlan=2,connect=127.0.0.1:12372 \ - ${do_vlan13:+-net socket,vlan=3,connect=127.0.0.1:12373} \ - -net nic,vlan=0,macaddr=52:54:00:12:34:01,model=e1000 \ - -net nic,vlan=0,macaddr=52:54:00:12:34:02,model=e1000 \ - -net nic,vlan=1,macaddr=52:54:00:12:34:03,model=e1000 \ - -net nic,vlan=2,macaddr=52:54:00:12:34:04,model=e1000 \ - -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ + -netdev socket,connect=127.0.0.1:12370,id=s1 -netdev hubport,hubid=1,id=h1,netdev=s1 \ + -netdev hubport,hubid=1,id=h2 -device e1000,mac=52:54:00:12:34:01,netdev=h2 \ + -netdev hubport,hubid=1,id=h3 -device e1000,mac=52:54:00:12:34:02,netdev=h3 \ + $nic1 -device e1000,mac=52:54:00:12:34:03,netdev=n1 \ + -netdev socket,connect=127.0.0.1:12372,id=n2 -device e1000,mac=52:54:00:12:34:04,netdev=n2 \ + $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ -watchdog i6300esb -watchdog-action poweroff \ -no-reboot \ -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing - { read OK if [[ "$OK" != "OK" ]]; then @@ -113,19 +116,19 @@ test_client() { client_test "Multiple VLAN" \ "yes" \ " -vlan=vlan0001:ens4 -vlan=vlan2:ens4 -vlan=ens4.3:ens4 -vlan=ens4.0004:ens4 +vlan=vlan0001:ens5 +vlan=vlan2:ens5 +vlan=ens5.3:ens5 +vlan=ens5.0004:ens5 ip=ens3:dhcp ip=192.168.54.101::192.168.54.1:24:test:vlan0001:none ip=192.168.55.102::192.168.55.1:24:test:vlan2:none -ip=192.168.56.103::192.168.56.1:24:test:ens4.3:none -ip=192.168.57.104::192.168.57.1:24:test:ens4.0004:none +ip=192.168.56.103::192.168.56.1:24:test:ens5.3:none +ip=192.168.57.104::192.168.57.1:24:test:ens5.0004:none rd.neednet=1 root=nfs:192.168.50.1:/nfs/client bootdev=ens3 " \ - 'ens3 ens4.0004 ens4.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" DEVICE="ens3" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4.0004 # Generated by dracut initrd NAME="ens4.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens4.0004" VLAN=yes PHYSDEV="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4.3 # Generated by dracut initrd NAME="ens4.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens4.3" VLAN=yes PHYSDEV="ens4" /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="ens4" /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="ens4" EOF ' \ + 'ens3 ens5.0004 ens5.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" DEVICE="ens3" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.0004 # Generated by dracut initrd NAME="ens5.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens5.0004" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.3 # Generated by dracut initrd NAME="ens5.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens5.3" VLAN=yes PHYSDEV="ens5" /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="ens5" /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="ens5" EOF ' \ || return 1 client_test "Multiple Bonds" \