From 7c88e76d308ff3911037a009ebd144c45c620541 Mon Sep 17 00:00:00 2001 From: Neetha John Date: Thu, 29 Jul 2021 18:08:14 -0700 Subject: [PATCH] [rdma] Skip nbrhosts fixture if no VM is present (#3913) Tgen topology used for RDMA testcase runs does not have any VMs defined which was causing those testcases to fail after this change #3656 Signed-off-by: Neetha John 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 --- tests/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7878527b85a..43e05d14f87 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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,