diff options
author | jack9603301 <jack9603301@163.com> | 2021-01-17 15:09:28 +0800 |
---|---|---|
committer | jack9603301 <jack9603301@163.com> | 2021-01-17 15:17:31 +0800 |
commit | 558e1ca9a8b80a9f6785ca0aedc26b6a03f4f3d8 (patch) | |
tree | 8bdd6a956a52f14a585ee2c51fbbc72161cde63e | |
parent | b2b5ea81243f672d3cc3c4082374551f38fd4dde (diff) | |
download | vyos-1x-558e1ca9a8b80a9f6785ca0aedc26b6a03f4f3d8.tar.gz vyos-1x-558e1ca9a8b80a9f6785ca0aedc26b6a03f4f3d8.zip |
smoketest: bridge: T3226: Repair bridge smoke test damage
-rw-r--r-- | python/vyos/configdict.py | 6 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_bridge.py | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 4f9d3739d..5acb1fdfe 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -272,9 +272,9 @@ def has_vlan_subinterface_configured(conf, intf): old_level = conf.get_level() conf.set_level([]) - intfpath = 'interfaces ' + Section.get_config_path(intf) - if ( conf.exists(f'{intfpath} vif') or - conf.exists(f'{intfpath} vif-s')): + intfpath = ['interfaces', Section.section(intf), intf] + if ( conf.exists(intfpath + ['vif']) or + conf.exists(intfpath + ['vif-s'])): ret = True conf.set_level(old_level) diff --git a/smoketest/scripts/cli/test_interfaces_bridge.py b/smoketest/scripts/cli/test_interfaces_bridge.py index 30364ca37..a6b96c9bd 100755 --- a/smoketest/scripts/cli/test_interfaces_bridge.py +++ b/smoketest/scripts/cli/test_interfaces_bridge.py @@ -202,6 +202,13 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): # remove VLAN interfaces for vif in vifs: self.session.delete(['interfaces', 'ethernet', member, 'vif', vif]) + + # delete all members + for interface in self._interfaces: + for member in self._members: + for vif in vifs: + self.session.delete(['interfaces', 'ethernet', member, 'vif', vif]) + self.session.delete(['interfaces', 'bridge', interface, 'member', 'interface', f'{member}.{vif}']) if __name__ == '__main__': unittest.main(verbosity=2) |