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 committed Nov 2, 2022
1 parent 52c561f commit e04bb43
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)
self.dvs_vlan.get_and_verify_vlan_ids(0)

Expand Down Expand Up @@ -487,6 +488,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)
self.dvs_vlan.get_and_verify_vlan_ids(0)

Expand Down

0 comments on commit e04bb43

Please sign in to comment.