diff options
author | jack9603301 <jack9603301@163.com> | 2020-12-03 12:11:43 +0800 |
---|---|---|
committer | jack9603301 <jack9603301@163.com> | 2020-12-03 12:11:43 +0800 |
commit | ede2972be4c49962a04b1addb9df6ce58f2d9f42 (patch) | |
tree | 6b1d7cd1e129d8363fee51c5d202fbff412bccab /smoketest/scripts/cli/base_interfaces_test.py | |
parent | 3169f1270fe8217fe57c9301e48b550539f14b77 (diff) | |
download | vyos-1x-ede2972be4c49962a04b1addb9df6ce58f2d9f42.tar.gz vyos-1x-ede2972be4c49962a04b1addb9df6ce58f2d9f42.zip |
interface: T3089: Migrate port mirroring to vyos-1x
Diffstat (limited to 'smoketest/scripts/cli/base_interfaces_test.py')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index e02424073..0a4e85c0f 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -33,6 +33,7 @@ class BasicInterfaceTest: _test_vlan = False _test_qinq = False _test_ipv6 = False + _test_mirror = False _base_path = [] _options = {} @@ -66,6 +67,33 @@ class BasicInterfaceTest: self.session.commit() del self.session + + def test_mirror(self): + Success = 0 + i = 0 + if self._test_mirror: + for interface in self._interfaces: + self.session.set(self._base_path + [interface, 'mirror', 'lo']) + i+=1 + self.session.commit() + # Parse configuration + for interface in self._interfaces: + get_tc_cmd = 'tc -j qdisc' + tmp = cmd(get_tc_cmd, shell=True) + data = json.loads(tmp) + for rule in data: + dev = rule['dev'] + handle = rule['handle'] + kind = rule['kind'] + if dev == interface and handle == "ffff:" and kind == "ingress": + Success+=1 + if Success == i: + self.assertTrue(True) + else: + self.assertTrue(False) + else: + return None + def test_add_description(self): """ |