Skip to content
Merged
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
6 changes: 6 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def test_config(ansible_adhoc, testbed):
bgp_facts = ans_host.bgp_facts()['ansible_facts']

# Initialize portchannel
if len(mg_facts['minigraph_portchannels'].keys()) == 0:
pytest.skip("Skip test due to there is no portchannel exists in current topology.")

portchannel = mg_facts['minigraph_portchannels'].keys()[0]
tmp_portchannel = "PortChannel999"
# Initialize portchannel_ip and portchannel_members
Expand All @@ -31,6 +34,9 @@ def test_config(ansible_adhoc, testbed):
logging.info("portchannel_members=%s" % portchannel_members)

try:
if len(portchannel_members) == 0:
pytest.skip("Skip test due to there is no portchannel member exists in current topology.")

# Step 1: Remove portchannel members from portchannel
for member in portchannel_members:
ans_host.shell("config portchannel member del %s %s" % (portchannel, member))
Expand Down