Skip to content

Commit

Permalink
[arp] Allow use of discontiguous ports with ARP tests. (sonic-net#3776
Browse files Browse the repository at this point in the history
…- tcusto:arp_discont)
  • Loading branch information
Tom Custodio authored and mannytaheri committed Mar 2, 2022
1 parent a370b71 commit bee2698
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions tests/arp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,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 bee2698

Please sign in to comment.