summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_ethernet.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-16 20:24:53 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-16 21:35:40 +0100
commit7375d9f06e5c8bc7e023c9ca3e40b2d83edbaaae (patch)
tree48927de761658137a1303d311f6ced96c19ef04d /smoketest/scripts/cli/test_interfaces_ethernet.py
parentf228a1ae057ad61bcdd04c02eae794ae595a2aba (diff)
downloadvyos-1x-7375d9f06e5c8bc7e023c9ca3e40b2d83edbaaae.tar.gz
vyos-1x-7375d9f06e5c8bc7e023c9ca3e40b2d83edbaaae.zip
smoketest: interfaces: use provided unittest framework assert methods
(cherry picked from commit b2b5ea81243f672d3cc3c4082374551f38fd4dde)
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_ethernet.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_ethernet.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_ethernet.py b/smoketest/scripts/cli/test_interfaces_ethernet.py
index 42c1f15df..9d896f690 100755
--- a/smoketest/scripts/cli/test_interfaces_ethernet.py
+++ b/smoketest/scripts/cli/test_interfaces_ethernet.py
@@ -78,8 +78,13 @@ class EthernetInterfaceTest(BasicInterfaceTest.BaseTest):
self.session.set(self._base_path + [interface, 'speed', 'auto'])
self.session.set(self._base_path + [interface, 'hw-id', self._macs[interface]])
- super().tearDown()
+ # Tear down mirror interfaces for SPAN (Switch Port Analyzer)
+ for span in self._mirror_interfaces:
+ section = Section.section(span)
+ self.session.delete(['interfaces', section, span])
+ self.session.commit()
+ del self.session
def test_dhcp_disable_interface(self):
# When interface is configured as admin down, it must be admin down
@@ -193,12 +198,12 @@ if __name__ == '__main__':
# Generate mandatory SSL certificate
tmp = f'openssl req -newkey rsa:4096 -new -nodes -x509 -days 3650 '\
f'-keyout {ssl_key} -out {ssl_cert} -subj {subject}'
- print(cmd(tmp))
+ cmd(tmp)
if not os.path.isfile(ca_cert):
# Generate "CA"
tmp = f'openssl req -new -x509 -key {ssl_key} -out {ca_cert} -subj {subject}'
- print(cmd(tmp))
+ cmd(tmp)
for file in [ca_cert, ssl_cert, ssl_key]:
cmd(f'sudo chown radius_priv_user:vyattacfg {file}')