Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions tests/arp/test_wr_arp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from tests.common.fixtures.ptfhost_utils import remove_ip_addresses # lgtm[py/unused-import]
from tests.common.storage_backend.backend_utils import skip_test_module_over_backend_topologies # lgtm[py/unused-import]
from tests.ptf_runner import ptf_runner
from tests.common.utilities import wait_until


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -94,17 +95,24 @@ def setupFerret(self, duthost, ptfhost, tbinfo):
(except the one for the deafult route) and take host IP from the subnet IP. For the output
above 192.168.8.0/25 subnet will be taken and host IP given to ferret script will be 192.168.8.1
'''
result = duthost.shell(
cmd='''ip route show type unicast |
sed -e '/proto 186\|proto zebra\|proto bgp/!d' -e '/default/d' -ne '/0\//p' |
head -n 1 |
sed -ne 's/0\/.*$/1/p'
'''
)
res = {}

def get_dip(duthost):

result = duthost.shell(
cmd='''ip route show type unicast |
sed -e '/proto 186\|proto zebra\|proto bgp/!d' -e '/default/d' -ne '/0\//p' |
head -n 1 |
sed -ne 's/0\/.*$/1/p'
'''
)
res["dip"] = result['stdout'] if len(result['stdout'].strip()) > 0 else ""

return res["dip"]

pytest_assert(len(result['stdout'].strip()) > 0, 'Empty DIP returned')
pytest_assert(wait_until(100, 10, 0, get_dip, duthost), 'Empty DIP returned')

dip = result['stdout']
dip = res['dip']
logger.info('VxLan Sender {0}'.format(dip))


Expand Down