aboutgitcodebugslistschat
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/passt.mbuto26
-rw-r--r--test/perf/passt_tcp2
-rw-r--r--test/perf/passt_udp2
-rw-r--r--test/two_guests/basic6
4 files changed, 26 insertions, 10 deletions
diff --git a/test/passt.mbuto b/test/passt.mbuto
index 150c062..968c1cd 100755
--- a/test/passt.mbuto
+++ b/test/passt.mbuto
@@ -11,7 +11,7 @@
# Author: Stefano Brivio <sbrivio@redhat.com>
PROGS="${PROGS:-ash,dash,bash ip mount ls insmod mkdir ln cat chmod lsmod
- modprobe find grep mknod mv rm umount jq iperf3 dhclient busybox logger
+ modprobe find grep mknod mv rm umount jq iperf3 dhclient hostname
sed tr chown sipcalc cut md5sum nc dd strace ping tail killall sleep
sysctl nproc tcp_rr tcp_crr udp_rr which tee seq bc}"
@@ -22,15 +22,29 @@ LINKS="${LINKS:-
ash,dash,bash /bin/sh
ash,dash,bash /usr/bin/bash}"
-COPIES="${COPIES}
- /sbin/dhclient-script"
+DIRS="${DIRS} /tmp /sbin"
-DIRS="${DIRS} /tmp"
+FIXUP="${FIXUP}"'
+ cat > /sbin/dhclient-script << EOF
+#!/bin/sh
+[ -n "\${new_interface_mtu}" ] && ip link set dev \${interface} mtu \${new_interface_mtu}
+
+[ -n "\${new_ip_address}" ] && ip addr add \${new_ip_address}/\${new_subnet_mask} dev \${interface}
+[ -n "\${new_routers}" ] && for r in \${new_routers}; do ip route add default via \${r} dev \${interface}; done
+[ -n "\${new_domain_name_servers}" ] && for d in \${new_domain_name_servers}; do echo "nameserver \${d}" >> /etc/resolv.conf; done
+[ -n "\${new_domain_name}" ] && (printf "search"; for d in \${new_domain_name}; do printf " %s" "\${d}"; done; printf "\n") >> /etc/resolv.conf
-FIXUP="${FIXUP}
+[ -n "\${new_ip6_address}" ] && ip addr add \${new_ip6_address}/\${new_ip6_prefixlen} dev \${interface}
+[ -n "\${new_dhcp6_name_servers}" ] && for d in \${new_dhcp6_name_servers}; do echo "nameserver \${d}%\${interface}" >> /etc/resolv.conf; done
+[ -n "\${new_dhcp6_domain_search}" ] && (printf "search"; for d in \${new_dhcp6_domain_search}; do printf " %s" "\${d}"; done; printf "\n") >> /etc/resolv.conf
+
+[ -n "\${new_host_name}" ] && hostname "\${new_host_name}"
+exit 0
+EOF
+ chmod 755 /sbin/dhclient-script
:> /etc/fstab
sh +m
-"
+'
OUTPUT="KERNEL=__KERNEL__
INITRD=__INITRD__
diff --git a/test/perf/passt_tcp b/test/perf/passt_tcp
index c97178e..555e211 100644
--- a/test/perf/passt_tcp
+++ b/test/perf/passt_tcp
@@ -18,7 +18,7 @@ htools bc head sed seq
# In this setup, virtio_net TX queue sometimes hangs, still under investigation
def virtio_net_workaround
-guest modprobe -r virtio_net; modprobe virtio_net napi_tx=1; dhclient -4; dhclient -6; sleep 3
+guest modprobe -r virtio_net; modprobe virtio_net napi_tx=1; ip link set dev eth0 up; dhclient -4; dhclient -6; sleep 3
endef
test passt: throughput and latency
diff --git a/test/perf/passt_udp b/test/perf/passt_udp
index 5155099..b840d85 100644
--- a/test/perf/passt_udp
+++ b/test/perf/passt_udp
@@ -18,7 +18,7 @@ htools bc head sed
# In this setup, virtio_net TX queue sometimes hangs, still under investigation
def virtio_net_workaround
-guest modprobe -r virtio_net; modprobe virtio_net napi_tx=1; dhclient -4; dhclient -6; sleep 3
+guest modprobe -r virtio_net; modprobe virtio_net napi_tx=1; ip link set dev eth0 up; dhclient -4; dhclient -6; sleep 3
endef
test passt: throughput and latency
diff --git a/test/two_guests/basic b/test/two_guests/basic
index afe104b..850a27b 100644
--- a/test/two_guests/basic
+++ b/test/two_guests/basic
@@ -23,8 +23,10 @@ check [ -n "__IFNAME1__" ]
check [ -n "__IFNAME2__" ]
test DHCP: addresses
+guest1 ip link set dev __IFNAME1__ up
guest1 /sbin/dhclient -4 __IFNAME1__
-guest2 /sbin/dhclient -4 __IFNAME1__
+guest2 ip link set dev __IFNAME2__ up
+guest2 /sbin/dhclient -4 __IFNAME2__
g1out ADDR1 ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__IFNAME1__").addr_info[0].local'
g2out ADDR2 ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__IFNAME2__").addr_info[0].local'
hout HOST_ADDR ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__HOST_IFNAME__").addr_info[0].local'
@@ -35,7 +37,7 @@ test DHCPv6: addresses
# Link is up now, wait for DAD to complete
sleep 2
guest1 /sbin/dhclient -6 __IFNAME1__
-guest2 /sbin/dhclient -6 __IFNAME1__
+guest2 /sbin/dhclient -6 __IFNAME2__
g1out ADDR1_6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME1__").addr_info[] | select(.prefixlen == 128).local'
g2out ADDR2_6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME2__").addr_info[] | select(.prefixlen == 128).local'
hout HOST_ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__HOST_IFNAME__").addr_info[] | select(.scope == "global").local'