From 964ef004065cc0227bfbc36ea655067fe88ad20f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 17 Jul 2020 20:43:42 +0200 Subject: interfaces: add basic, reusable 802.1ad (Q-in-Q) testcase --- scripts/cli/base_interfaces_test.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'scripts/cli/base_interfaces_test.py') 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) -- cgit v1.2.3