summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/base_interfaces_test.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-25 18:50:50 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-25 19:15:17 +0200
commitbd5e25d6f476feed953a2753d9c3f9961b467126 (patch)
treeb58370c7203de78e53153af740dda9d858f0fc86 /smoketest/scripts/cli/base_interfaces_test.py
parentdc864082ef896faa7adba8312d782d7066492aa7 (diff)
downloadvyos-1x-bd5e25d6f476feed953a2753d9c3f9961b467126.tar.gz
vyos-1x-bd5e25d6f476feed953a2753d9c3f9961b467126.zip
smoketest: migrate pppoe, and wireguard to setUpClass() scheme
Diffstat (limited to 'smoketest/scripts/cli/base_interfaces_test.py')
-rw-r--r--smoketest/scripts/cli/base_interfaces_test.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py
index ba5acf5d6..816ba6dcd 100644
--- a/smoketest/scripts/cli/base_interfaces_test.py
+++ b/smoketest/scripts/cli/base_interfaces_test.py
@@ -78,18 +78,25 @@ class BasicInterfaceTest:
# choose IPv6 minimum MTU value for tests - this must always work
_mtu = '1280'
- def setUp(self):
+ @classmethod
+ def setUpClass(cls):
+ super(BasicInterfaceTest.TestCase, cls).setUpClass()
+
# Setup mirror interfaces for SPAN (Switch Port Analyzer)
- for span in self._mirror_interfaces:
+ for span in cls._mirror_interfaces:
section = Section.section(span)
- self.cli_set(['interfaces', section, span])
+ cls.cli_set(cls, ['interfaces', section, span])
- def tearDown(self):
+ @classmethod
+ def tearDownClass(cls):
# Tear down mirror interfaces for SPAN (Switch Port Analyzer)
- for span in self._mirror_interfaces:
+ for span in cls._mirror_interfaces:
section = Section.section(span)
- self.cli_delete(['interfaces', section, span])
+ cls.cli_delete(cls, ['interfaces', section, span])
+ super(BasicInterfaceTest.TestCase, cls).tearDownClass()
+
+ def tearDown(self):
self.cli_delete(self._base_path)
self.cli_commit()
@@ -232,6 +239,7 @@ class BasicInterfaceTest:
self.cli_commit()
for interface in self._interfaces:
+ self.assertIn(AF_INET6, ifaddresses(interface))
for addr in ifaddresses(interface)[AF_INET6]:
self.assertTrue(is_ipv6_link_local(addr['addr']))