From 7375d9f06e5c8bc7e023c9ca3e40b2d83edbaaae Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 16 Jan 2021 20:24:53 +0100 Subject: smoketest: interfaces: use provided unittest framework assert methods (cherry picked from commit b2b5ea81243f672d3cc3c4082374551f38fd4dde) --- smoketest/scripts/cli/test_interfaces_ethernet.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'smoketest/scripts/cli/test_interfaces_ethernet.py') 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}') -- cgit v1.2.3