summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-07-26 10:23:56 +0200
committerChristian Poessinger <christian@poessinger.com>2020-07-26 10:23:56 +0200
commite388ed14fa31f403cd9aadf99965b253fad9f816 (patch)
treedf79be1db6d0ee298d0020196215623f4845c659 /scripts
parentfbfab33180dfac893df6447ab3fb5ef9fa8d7e28 (diff)
downloadvyos-1x-e388ed14fa31f403cd9aadf99965b253fad9f816.tar.gz
vyos-1x-e388ed14fa31f403cd9aadf99965b253fad9f816.zip
pseudo-ethernet: extend smoketests with VIFs
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cli/base_interfaces_test.py12
-rwxr-xr-xscripts/cli/test_interfaces_pseudo_ethernet.py23
2 files changed, 22 insertions, 13 deletions
diff --git a/scripts/cli/base_interfaces_test.py b/scripts/cli/base_interfaces_test.py
index fa3e8a0c1..8fae5970e 100644
--- a/scripts/cli/base_interfaces_test.py
+++ b/scripts/cli/base_interfaces_test.py
@@ -142,9 +142,13 @@ class BasicInterfaceTest:
if not self._test_vlan:
return None
- for intf in self._interfaces:
+ for interface in self._interfaces:
+ base = self._base_path + [interface]
+ for option in self._options.get(interface, []):
+ self.session.set(base + option.split())
+
for vlan in self._vlan_range:
- base = self._base_path + [intf, 'vif', vlan]
+ base = self._base_path + [interface, 'vif', vlan]
self.session.set(base + ['mtu', self._mtu])
for address in self._test_addr:
self.session.set(base + ['address', address])
@@ -164,6 +168,10 @@ class BasicInterfaceTest:
return None
for interface in self._interfaces:
+ base = self._base_path + [interface]
+ for option in self._options.get(interface, []):
+ self.session.set(base + option.split())
+
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]
diff --git a/scripts/cli/test_interfaces_pseudo_ethernet.py b/scripts/cli/test_interfaces_pseudo_ethernet.py
index 1f5de4f61..bc2e6e7eb 100755
--- a/scripts/cli/test_interfaces_pseudo_ethernet.py
+++ b/scripts/cli/test_interfaces_pseudo_ethernet.py
@@ -21,18 +21,19 @@ from base_interfaces_test import BasicInterfaceTest
class PEthInterfaceTest(BasicInterfaceTest.BaseTest):
def setUp(self):
- super().setUp()
- self._base_path = ['interfaces', 'pseudo-ethernet']
- options = ['source-interface eth0', 'ip arp-cache-timeout 10',
- 'ip disable-arp-filter', 'ip enable-arp-accept',
- 'ip enable-arp-announce', 'ip enable-arp-ignore',
- 'ip enable-proxy-arp', 'ip proxy-arp-pvlan']
+ super().setUp()
+ self._base_path = ['interfaces', 'pseudo-ethernet']
- self._options = {
- 'peth0': options,
- 'peth1': options,
- }
- self._interfaces = list(self._options)
+ self._test_ip = True
+ self._test_mtu = True
+ self._test_vlan = True
+ self._test_qinq = True
+
+ self._options = {
+ 'peth0': ['source-interface eth1'],
+ 'peth1': ['source-interface eth1'],
+ }
+ self._interfaces = list(self._options)
if __name__ == '__main__':
unittest.main()