From a8986425a4af56a50c8986228e2df04efc5f9edf Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 5 Apr 2013 11:05:39 +0200
Subject: [PATCH] TEST-50-MULTINIC: fixup test suite
qemu of the day doesn't like multicast anymore
---
test/TEST-50-MULTINIC/server-init.sh | 54 +++++++++++++++++++++++++++++++++---
test/TEST-50-MULTINIC/test.sh | 23 +++++++--------
2 files changed, 60 insertions(+), 17 deletions(-)
diff --git a/test/TEST-50-MULTINIC/server-init.sh b/test/TEST-50-MULTINIC/server-init.sh
index 144f83c..5a8359b 100755
--- a/test/TEST-50-MULTINIC/server-init.sh
+++ b/test/TEST-50-MULTINIC/server-init.sh
@@ -7,11 +7,53 @@ export PS1='nfstest-server:\w\$ '
stty sane
echo "made it to the rootfs!"
echo server > /proc/sys/kernel/hostname
+
+wait_for_if_link() {
+ local cnt=0
+ local li
+ while [ $cnt -lt 600 ]; do
+ li=$(ip -o link show dev $1 2>/dev/null)
+ [ -n "$li" ] && return 0
+ sleep 0.1
+ cnt=$(($cnt+1))
+ done
+ return 1
+}
+
+wait_for_if_up() {
+ local cnt=0
+ local li
+ while [ $cnt -lt 200 ]; do
+ li=$(ip -o link show up dev $1)
+ [ -n "$li" ] && return 0
+ sleep 0.1
+ cnt=$(($cnt+1))
+ done
+ return 1
+}
+
+wait_for_route_ok() {
+ local cnt=0
+ while [ $cnt -lt 200 ]; do
+ li=$(ip route show)
+ [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+ sleep 0.1
+ cnt=$(($cnt+1))
+ done
+ return 1
+}
+
+linkup() {
+ wait_for_if_link $1 2>/dev/null\
+ && ip link set $1 up 2>/dev/null\
+ && wait_for_if_up $1 2>/dev/null
+}
+
>/dev/watchdog
ip addr add 127.0.0.1/8 dev lo
-ip link set lo up
+linkup lo
ip addr add 192.168.50.1/24 dev eth0
-ip link set eth0 up
+linkup eth0
>/dev/watchdog
modprobe af_packet
> /dev/watchdog
@@ -42,10 +84,14 @@ exportfs -r
chmod 777 /var/lib/dhcpd/dhcpd.leases
>/dev/watchdog
dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
-echo -n 'V' > /dev/watchdog
+#echo -n 'V' > /dev/watchdog
#sh -i
+#tcpdump -i eth0
# Wait forever for the VM to die
echo "Serving NFS mounts"
-while :; do sleep 30; done
+while :; do
+ sleep 10
+ >/dev/watchdog
+done
mount -n -o remount,ro /
poweroff -f
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
index a3aa679..5cb0971 100755
--- a/test/TEST-50-MULTINIC/test.sh
+++ b/test/TEST-50-MULTINIC/test.sh
@@ -8,7 +8,6 @@ KVERSION=${KVERSION-$(uname -r)}
# Uncomment this to debug failures
#DEBUGFAIL="rd.shell"
#SERIAL="tcp:127.0.0.1:9999"
-SERIAL="null"
run_server() {
# Start server first
@@ -19,9 +18,9 @@ run_server() {
-hda $TESTDIR/server.ext3 \
-m 512M -smp 2 \
-display none \
- -netdev socket,mcast=230.0.0.1:12320,id=net0 \
- -net nic,macaddr=52:54:01:12:34:56,model=e1000,netdev=net0 \
- -serial $SERIAL \
+ -net socket,listen=127.0.0.1:12350 \
+ -net nic,macaddr=52:54:01:12:34:56,model=e1000 \
+ ${SERIAL+-serial $SERIAL} \
-watchdog i6300esb -watchdog-action poweroff \
-kernel /boot/vmlinuz-$KVERSION \
-append "loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
@@ -53,15 +52,13 @@ client_test() {
fi
$testdir/run-qemu -hda $TESTDIR/client.img -m 512M -smp 2 -nographic \
- -netdev socket,mcast=230.0.0.1:12320,id=net0 \
- -net nic,netdev=net0,macaddr=52:54:00:12:34:$mac1,model=e1000 \
- -netdev socket,mcast=230.0.0.1:12320,id=net1 \
- -net nic,netdev=net1,macaddr=52:54:00:12:34:$mac2,model=e1000 \
- -netdev socket,mcast=230.0.0.1:12320,id=net2 \
- -net nic,netdev=net2,macaddr=52:54:00:12:34:$mac3,model=e1000 \
+ -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 \
-watchdog i6300esb -watchdog-action poweroff \
-kernel /boot/vmlinuz-$KVERSION \
- -append "$cmdline $DEBUGFAIL rd.retry=5 rd.info ro rd.systemd.log_level=debug console=ttyS0,115200n81 selinux=0 rd.copystate rd.chroot init=/sbin/init" \
+ -append "$cmdline $DEBUGFAIL rd.retry=5 rd.info ro console=ttyS0,115200n81 selinux=0 init=/sbin/init" \
-initrd $TESTDIR/initramfs.testing
if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then
@@ -252,14 +249,14 @@ test_setup() {
# Make server's dracut image
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
-m "dash udev-rules base rootfs-block debug kernel-modules watchdog" \
- -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esbwdt" \
+ -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esb ib700wdt" \
-f $TESTDIR/initramfs.server $KVERSION || return 1
# Make client's dracut image
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
-o "plymouth" \
-a "debug" \
- -d "af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esbwdt" \
+ -d "af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esb ib700wdt" \
-f $TESTDIR/initramfs.testing $KVERSION || return 1
}