Skip to content

Commit

Permalink
[arp] Allow use of discontiguous ports with ARP tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Custodio committed Jul 12, 2021
1 parent 1ee79c0 commit 60ac548
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions tests/arp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,27 @@ def intfs_for_test(duthosts, enum_rand_one_per_hwsku_frontend_hostname, enum_fro
intf1 = ports_for_test[0]
intf2 = ports_for_test[1]
else:
# Select port index 0 & 1 two interfaces for testing
intf1 = ports[0]
intf2 = ports[1]
# Select first 2 ports that are admin 'up'
if duthost.is_multi_asic:
intf_status = duthost.show_interface(command='status', namespace=asic.namespace)['ansible_facts'][
'int_status']
else:
intf_status = duthost.show_interface(command='status')['ansible_facts']['int_status']

intf1 = None
intf2 = None
for a_port in ports:
if intf_status[a_port]['admin_state'] == 'up':
if intf1 is None:
intf1 = a_port
elif intf2 is None:
intf2 = a_port
else:
break

if intf1 is None or intf2 is None:
pytest.skip("Not enough interfaces on this host/asic (%s/%s) to support test." % (duthost.hostname,
asic.asic_index))

po1 = get_po(mg_facts, intf1)
po2 = get_po(mg_facts, intf2)
Expand Down

0 comments on commit 60ac548

Please sign in to comment.