diff options
author | jack9603301 <jack9603301@163.com> | 2020-12-13 17:03:01 +0800 |
---|---|---|
committer | jack9603301 <jack9603301@163.com> | 2020-12-13 17:03:01 +0800 |
commit | e08b381d07b322b8bf5daebbf2ca1c977c14d408 (patch) | |
tree | 184366bd656c34fb4c27510f8b0f6f08b8743c3c /smoketest | |
parent | 505c5efaf1e852a3e90276baacdb235c4c3e41b2 (diff) | |
download | vyos-1x-e08b381d07b322b8bf5daebbf2ca1c977c14d408.tar.gz vyos-1x-e08b381d07b322b8bf5daebbf2ca1c977c14d408.zip |
interfaces: mirror: T3089: Fix the dependency problem between interfaces
Since the dependency problem has not been solved before,
if the monitoring interface does not exist when the
mirror rule is created, the execution will be abnormal
Diffstat (limited to 'smoketest')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index d1bb9c3fe..cef920f04 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -86,13 +86,21 @@ class BasicInterfaceTest: del self.session def test_mirror(self): - Success = 0 - i = 0 + if self._test_mirror: + + # Create test dependency interface + self.session.set(['interfaces','dummy','dum0']) + self.session.set(['interfaces','dummy','dum1']) + self.session.set(['interfaces','bonding','bond1','member','interface','dum0']) + self.session.set(['interfaces','bonding','bond1','member','interface','dum1']) + + Success = 0 + i = 0 # Check the two-way mirror rules of ingress and egress for interface in self._interfaces: - self.session.set(self._base_path + [interface, 'mirror', 'ingress', 'lo']) - self.session.set(self._base_path + [interface, 'mirror', 'egress', 'lo']) + self.session.set(self._base_path + [interface, 'mirror', 'ingress', 'bond1']) + self.session.set(self._base_path + [interface, 'mirror', 'egress', 'bond1']) i+=1 self.session.commit() # Parse configuration @@ -102,6 +110,8 @@ class BasicInterfaceTest: else: self.assertTrue(False) i=0 + self.session.delete(['interfaces','dummy']) + self.session.delete(['interfaces','bonding']) else: return None |