qemu-test: add support for named choices
[qemu-test.git] / tests / simple-ping.sh
1 #!/bin/sh
2
3 in_host() {
4 nic=`named_choose nic tier2 rtl8139 e1000 virtio`
5 if test "$nic" = "tier2"; then
6 nic=`named_choose nic.tier2 ne2k_pci i82551 i82557b i82559er pcnet`
7 fi
8 echo "Using networking card: $nic"
9 qemu -nographic -enable-kvm -net user -net nic,model=$nic
10 }
11
12 in_guest() {
13 udhcpc -i eth0 -f -n -q
14 wget -O /dev/null http://www.qemu.org
15 }
16
17 if test $QEMU_TEST; then
18 in_host
19 else
20 in_guest
21 fi