Skip to content

Commit

Permalink
Merge pull request autotest#5654 from yalzhang/get_iface_name_2vm
Browse files Browse the repository at this point in the history
Get the iface name from the guest os
  • Loading branch information
chunfuwen committed Aug 15, 2024
2 parents 0a91877 + 08ec2f1 commit df3ba46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@
ipv6_addr_c = '2001:db8:ac10:fd01::20'
ips = {'ips': [{'address': '${ipv4_addr_c}', 'family': 'ipv4', 'prefix': '24'}, {'address': '${ipv6_addr_c}', 'family': 'ipv6'}]}
iface_c_attrs = {'model': 'virtio', 'acpi': {'index': '1'}, **${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, 'type_name': 'user'}
vm_c_iface = eno1
conn_check_args_0 = ('TCP4', server_default_gw, None, 41335, 41335)
conn_check_args_1 = ('TCP6', server_default_gw_v6, vm_c_iface, 41335, 41335)
conn_check_args_2 = ('UDP4', server_default_gw, None, 21335, 21335)
conn_check_args_3 = ('UDP6', server_default_gw_v6, vm_c_iface, 21335, 21335)
s390-virtio:
iface_attrs = {'model': 'virtio', **${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, 'type_name': 'user', **${portForwards}}
iface_c_attrs = {'model': 'virtio', **${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, 'type_name': 'user'}
vm_c_iface = enc1
conn_check_args_0 = ('TCP4', server_default_gw, None, 41335, 41335)
conn_check_args_1 = ('TCP6', server_default_gw_v6, vm_c_iface, 41335, 41335)
conn_check_args_2 = ('UDP4', server_default_gw, None, 21335, 21335)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def run(test, params, env):
iface_c_attrs = eval(params.get('iface_c_attrs'))
params['socket_dir'] = socket_dir = eval(params.get('socket_dir'))
params['proc_checks'] = proc_checks = eval(params.get('proc_checks', '{}'))
vm_c_iface = params.get('vm_c_iface', 'eno1')
host_iface = params.get('host_iface')
host_iface = host_iface if host_iface else utils_net.get_default_gateway(
iface_name=True, force_dhcp=True).split()[0]
Expand Down Expand Up @@ -100,6 +99,8 @@ def run(test, params, env):
time.sleep(5)
server_session = vm.wait_for_serial_login(60)
client_session = vm_c.wait_for_serial_login(60)
mac = vm_c.get_virsh_mac_address()
vm_c_iface = utils_net.get_linux_ifname(client_session, mac)

[LOG.debug(session.cmd_output('ip a'))
for session in (server_session, client_session)]
Expand Down

0 comments on commit df3ba46

Please sign in to comment.