Skip to content

Commit

Permalink
[rdma] Skip nbrhosts fixture if no VM is present (sonic-net#3913)
Browse files Browse the repository at this point in the history
Tgen topology used for RDMA testcase runs does not have any VMs defined which was causing those testcases to fail after this change sonic-net#3656

Signed-off-by: Neetha John <[email protected]>

How did you do it?
Skip nbrhosts fixture if no VMs are present in the topology

How did you verify/test it?
Executed 'tgen' testcases with the fix and they passed
  • Loading branch information
neethajohn authored and vmittal-msft committed Sep 28, 2021
1 parent b0295df commit 7c88e76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,13 @@ def nbrhosts(ansible_adhoc, tbinfo, creds, request):
Shortcut fixture for getting VM host
"""

devices = {}
if not tbinfo['vm_base'] and 'tgen' in tbinfo['topo']['name']:
logger.info("No VMs exist for this topology: {}".format(tbinfo['topo']['name']))
return devices

vm_base = int(tbinfo['vm_base'][2:])
neighbor_type = request.config.getoption("--neighbor_type")
devices = {}
for k, v in tbinfo['topo']['properties']['topology']['VMs'].items():
if neighbor_type == "eos":
devices[k] = {'host': EosHost(ansible_adhoc,
Expand Down

0 comments on commit 7c88e76

Please sign in to comment.