diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-14 22:41:41 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-09-15 08:08:14 +0200 |
commit | 8eeb1bdcdfc104ffa77531f270a38cda2aee7f82 (patch) | |
tree | e8624e3673bdb6fd08966cc984defc7b31fcc08f /smoketest/scripts | |
parent | 0ee8d5e35044e7480dac6a23e92d43744b8c5d36 (diff) | |
download | vyos-1x-8eeb1bdcdfc104ffa77531f270a38cda2aee7f82.tar.gz vyos-1x-8eeb1bdcdfc104ffa77531f270a38cda2aee7f82.zip |
bond: T6709: add EAPoL support
Diffstat (limited to 'smoketest/scripts')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 33 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_ethernet.py | 2 |
2 files changed, 19 insertions, 16 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index 5708393e1..593b4b415 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -1240,6 +1240,8 @@ class BasicInterfaceTest: if not self._test_eapol: self.skipTest('not supported') + cfg_dir = '/run/wpa_supplicant' + ca_certs = { 'eapol-server-ca-root': server_ca_root_cert_data, 'eapol-server-ca-intermediate': server_ca_intermediate_cert_data, @@ -1274,9 +1276,6 @@ class BasicInterfaceTest: self.cli_commit() - # Check for running process - self.assertTrue(process_named_running('wpa_supplicant')) - # Validate interface config for interface in self._interfaces: tmp = get_wpa_supplicant_value(interface, 'key_mgmt') @@ -1289,29 +1288,33 @@ class BasicInterfaceTest: self.assertEqual('0', tmp) tmp = get_wpa_supplicant_value(interface, 'ca_cert') - self.assertEqual(f'"/run/wpa_supplicant/{interface}_ca.pem"', tmp) + self.assertEqual(f'"{cfg_dir}/{interface}_ca.pem"', tmp) tmp = get_wpa_supplicant_value(interface, 'client_cert') - self.assertEqual(f'"/run/wpa_supplicant/{interface}_cert.pem"', tmp) + self.assertEqual(f'"{cfg_dir}/{interface}_cert.pem"', tmp) tmp = get_wpa_supplicant_value(interface, 'private_key') - self.assertEqual(f'"/run/wpa_supplicant/{interface}_cert.key"', tmp) + self.assertEqual(f'"{cfg_dir}/{interface}_cert.key"', tmp) mac = read_file(f'/sys/class/net/{interface}/address') tmp = get_wpa_supplicant_value(interface, 'identity') self.assertEqual(f'"{mac}"', tmp) - # Check certificate files have the full chain - self.assertEqual(get_certificate_count(interface, 'ca'), 2) - self.assertEqual(get_certificate_count(interface, 'cert'), 3) + # Check certificate files have the full chain + self.assertEqual(get_certificate_count(interface, 'ca'), 2) + self.assertEqual(get_certificate_count(interface, 'cert'), 3) - for name in ca_certs: - self.cli_delete(['pki', 'ca', name]) - self.cli_delete(['pki', 'certificate', cert_name]) + # Check for running process + self.assertTrue(process_named_running('wpa_supplicant', cmdline=f'-i{interface}')) # Remove EAPoL configuration - self.cli_delete(self._base_path + [interface, 'eapol']) - # Commit + for interface in self._interfaces: + self.cli_delete(self._base_path + [interface, 'eapol']) + + # Commit and check that process is no longer running self.cli_commit() - # Daemon must no longer be running self.assertFalse(process_named_running('wpa_supplicant')) + + for name in ca_certs: + self.cli_delete(['pki', 'ca', name]) + self.cli_delete(['pki', 'certificate', cert_name]) diff --git a/smoketest/scripts/cli/test_interfaces_ethernet.py b/smoketest/scripts/cli/test_interfaces_ethernet.py index 3c8a9b663..3d12364f7 100755 --- a/smoketest/scripts/cli/test_interfaces_ethernet.py +++ b/smoketest/scripts/cli/test_interfaces_ethernet.py @@ -223,4 +223,4 @@ class EthernetInterfaceTest(BasicInterfaceTest.TestCase): self.assertIn(f' evpn mh uplink', frrconfig) if __name__ == '__main__': - unittest.main(verbosity=2, failfast=True) + unittest.main(verbosity=2) |