summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-07-17 20:43:42 +0200
committerChristian Poessinger <christian@poessinger.com>2020-07-17 20:43:42 +0200
commit964ef004065cc0227bfbc36ea655067fe88ad20f (patch)
tree70b608fe4ae3908f247b36fa80bc22e9ea3e8c7e /scripts
parenta76433c1fde7e7a2c2ee7d5e4078815fb7211184 (diff)
downloadvyos-1x-964ef004065cc0227bfbc36ea655067fe88ad20f.tar.gz
vyos-1x-964ef004065cc0227bfbc36ea655067fe88ad20f.zip
interfaces: add basic, reusable 802.1ad (Q-in-Q) testcase
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cli/base_interfaces_test.py22
-rwxr-xr-xscripts/cli/test_interfaces_ethernet.py1
2 files changed, 23 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)
diff --git a/scripts/cli/test_interfaces_ethernet.py b/scripts/cli/test_interfaces_ethernet.py
index 9ca8a7a02..7f706aabb 100755
--- a/scripts/cli/test_interfaces_ethernet.py
+++ b/scripts/cli/test_interfaces_ethernet.py
@@ -27,6 +27,7 @@ class EthernetInterfaceTest(BasicInterfaceTest.BaseTest):
self._base_path = ['interfaces', 'ethernet']
self._test_mtu = True
self._test_vlan = True
+ self._test_qinq = True
self._interfaces = []
# we need to filter out VLAN interfaces identified by a dot (.)