diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-07-17 20:43:42 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-07-17 20:43:42 +0200 |
commit | 964ef004065cc0227bfbc36ea655067fe88ad20f (patch) | |
tree | 70b608fe4ae3908f247b36fa80bc22e9ea3e8c7e /scripts/cli/base_interfaces_test.py | |
parent | a76433c1fde7e7a2c2ee7d5e4078815fb7211184 (diff) | |
download | vyos-1x-964ef004065cc0227bfbc36ea655067fe88ad20f.tar.gz vyos-1x-964ef004065cc0227bfbc36ea655067fe88ad20f.zip |
interfaces: add basic, reusable 802.1ad (Q-in-Q) testcase
Diffstat (limited to 'scripts/cli/base_interfaces_test.py')
-rw-r--r-- | scripts/cli/base_interfaces_test.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/cli/base_interfaces_test.py b/scripts/cli/base_interfaces_test.py index 20899b9b1..72696f780 100644 --- a/scripts/cli/base_interfaces_test.py +++ b/scripts/cli/base_interfaces_test.py @@ -29,6 +29,7 @@ class BasicInterfaceTest: _options = {} _interfaces = [] + _qinq_range = ['10', '20', '30'] _vlan_range = ['100', '200', '300', '2000'] # choose IPv6 minimum MTU value for tests - this must always work _mtu = '1280' @@ -155,3 +156,24 @@ class BasicInterfaceTest: self._mtu_test(vif) + def test_8021ad_qinq_vlan(self): + """ Testcase for 802.1ad Q-in-Q VLAN interfaces """ + if not self._test_qinq: + return None + + for interface in self._interfaces: + for vif_s in self._qinq_range: + for vif_c in self._vlan_range: + base = self._base_path + [interface, 'vif-s', vif_s, 'vif-c', vif_c] + self.session.set(base + ['mtu', self._mtu]) + for address in self._test_addr: + self.session.set(base + ['address', address]) + + self.session.commit() + for interface in self._interfaces: + for vif_s in self._qinq_range: + for vif_c in self._vlan_range: + vif = f'{interface}.{vif_s}.{vif_c}' + for address in self._test_addr: + self.assertTrue(is_intf_addr_assigned(vif, address)) + self._mtu_test(vif) |