Skip to content

Commit eca73bc

Browse files
committed
Fix pktgen tx test netdst conversion, mac address and vm startup issues
1. Fix netdst conversion: convert 'private' to 'atbr0' for host IP lookup 2. Fix vm startup: check if vm is alive before starting 3. Fix mac address: use tap device mac instead of default gateway mac Signed-off-by: Wenli Quan<wquan@redhat.com>
1 parent 03bfa09 commit eca73bc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

libvirt/tests/src/virtual_network/qemu/pktgen_burst_mode_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def run_test():
6161
pktgen_utils.install_package(host_ver)
6262

6363
test.log.debug("TEST_STEP 2: Test with guest and host connectivity")
64-
vm.start()
64+
if not vm.is_alive():
65+
vm.start()
66+
vm.verify_alive()
6567
test.log.debug("Test with Guest xml:%s", vm_xml.VMXML.new_from_dumpxml(vm_name))
6668
session = vm.wait_for_serial_login(restart_network=True)
6769
network_base.ping_check(params, ips, session, force_ipv4=True)
@@ -96,6 +98,9 @@ def run_test():
9698
guest_ver_cmd = params.get("guest_ver_cmd")
9799
test_vm = params.get_boolean("test_vm")
98100
host_ver = os.uname().release
99-
ips = {'host_ip': utils_net.get_host_ip_address(params)}
101+
params_for_ip = params.copy()
102+
if params.get("netdst") == "private":
103+
params_for_ip["netdst"] = params.get("priv_brname", "atbr0")
104+
ips = {'host_ip': utils_net.get_host_ip_address(params_for_ip)}
100105

101106
run_test()

provider/virtual_network/pktgen_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def configure_pktgen(
4141
vm.copy_files_to(source_path, self.dest_path)
4242
guest_mac = vm.get_mac_address(0)
4343
self.interface = utils_net.get_linux_ifname(session_serial, guest_mac)
44-
host_iface = utils_net.get_default_gateway(iface_name=True, force_dhcp=False, json=True)
44+
host_iface = libvirt.get_ifname_host(vm.name, guest_mac)
4545
dsc_dev = utils_net.Interface(host_iface)
4646
self.dsc = dsc_dev.get_mac()
4747
self.runner = session_serial.cmd

0 commit comments

Comments
 (0)