Skip to content

Commit

Permalink
Fix vs test issue: failed to remove vlan due to referenced by vlan in…
Browse files Browse the repository at this point in the history
…terface (#2504)

*Fix: remove vlan interface before removing the vlan itself
  • Loading branch information
stephenxs authored and yxieca committed Nov 29, 2022
1 parent 11bef87 commit 434e80c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/dvslib/dvs_vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def remove_vlan_member(self, vlanID, interface):
member = "Vlan{}|{}".format(vlanID, interface)
self.config_db.delete_entry("VLAN_MEMBER", member)

def remove_vlan_interface(self, vlanID):
vlan = "Vlan{}".format(vlanID)
self.config_db.delete_entry("VLAN_INTERFACE", vlan)

def check_app_db_vlan_fields(self, fvs, admin_status="up", mtu="9100"):
assert fvs.get("admin_status") == admin_status
assert fvs.get("mtu") == mtu
Expand Down
2 changes: 2 additions & 0 deletions tests/test_vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def arp_accept_disabled():

wait_for_result(arp_accept_disabled, PollingConfig(), "IPv4 arp_accept not disabled")

self.dvs_vlan.remove_vlan_interface(vlan)
self.dvs_vlan.remove_vlan(vlan)

def test_VlanProxyArp(self, dvs):
Expand Down Expand Up @@ -486,6 +487,7 @@ def proxy_arp_disabled():

wait_for_result(proxy_arp_disabled, PollingConfig(), 'IPv4 proxy_arp or proxy_arp_pvlan not disabled')

self.dvs_vlan.remove_vlan_interface(vlan)
self.dvs_vlan.remove_vlan(vlan)

# Add Dummy always-pass test at end as workaroud
Expand Down

0 comments on commit 434e80c

Please sign in to comment.