diff options
| author | Alex Kudentsov <43482574+alexk37@users.noreply.github.com> | 2026-03-17 12:21:14 +0700 |
|---|---|---|
| committer | Alex Kudentsov <43482574+alexk37@users.noreply.github.com> | 2026-03-17 12:21:14 +0700 |
| commit | 3d02ba26b07a40c18e1d2b90f30985544086d8d4 (patch) | |
| tree | ef97631a3e5e999a7ea8b5a743ddf8c4e3b9900b /smoketest/scripts/cli | |
| parent | 3112d1cb99582db99ed460bcb835fc12feede7dd (diff) | |
| download | vyos-1x-3d02ba26b07a40c18e1d2b90f30985544086d8d4.tar.gz vyos-1x-3d02ba26b07a40c18e1d2b90f30985544086d8d4.zip | |
T8389: extend tests with md5 password check
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_isis.py | 24 | ||||
| -rw-r--r-- | smoketest/scripts/cli/test_protocols_openfabric.py | 18 |
2 files changed, 42 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_isis.py b/smoketest/scripts/cli/test_protocols_isis.py index 5d61f4ce0..c0d505616 100755 --- a/smoketest/scripts/cli/test_protocols_isis.py +++ b/smoketest/scripts/cli/test_protocols_isis.py @@ -167,6 +167,7 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): def test_isis_05_password(self): password = 'foo' + md5_password = 'secret_md5_hash' self.cli_set(base_path + ['net', net]) for interface in self._interfaces: @@ -200,6 +201,29 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): tmp = self.getFRRconfig(f'interface {interface}', stop_section='^exit') self.assertIn(f' isis password clear {password}-{interface}', tmp) + # Switch to MD5 passwords - delete plaintext passwords first + self.cli_delete(base_path + ['area-password', 'plaintext-password']) + self.cli_delete(base_path + ['domain-password', 'plaintext-password']) + for interface in self._interfaces: + self.cli_delete(base_path + ['interface', interface, 'password', 'plaintext-password']) + + self.cli_set(base_path + ['domain-password', 'md5', md5_password]) + self.cli_set(base_path + ['area-password', 'md5', md5_password]) + for interface in self._interfaces: + self.cli_set(base_path + ['interface', interface, 'password', 'md5', md5_password]) + + # Commit all changes + self.cli_commit() + + # Verify all changes + tmp = self.getFRRconfig(f'router isis {domain}', stop_section='exit') + self.assertIn(f' domain-password md5 {md5_password}', tmp) + self.assertIn(f' area-password md5 {md5_password}', tmp) + + for interface in self._interfaces: + tmp = self.getFRRconfig(f'interface {interface}', stop_section='^exit') + self.assertIn(f' isis password md5 {md5_password}', tmp) + def test_isis_06_spf_delay_bfd(self): network = 'point-to-point' holddown = '10' diff --git a/smoketest/scripts/cli/test_protocols_openfabric.py b/smoketest/scripts/cli/test_protocols_openfabric.py index f5dcc53cd..c1e6f6598 100644 --- a/smoketest/scripts/cli/test_protocols_openfabric.py +++ b/smoketest/scripts/cli/test_protocols_openfabric.py @@ -117,6 +117,7 @@ class TestProtocolsOpenFabric(VyOSUnitTestSHIM.TestCase): def test_openfabric_03_password(self): password = 'foo' + md5_password = 'secret_md5_hash' self.openfabric_base_config() @@ -147,6 +148,23 @@ class TestProtocolsOpenFabric(VyOSUnitTestSHIM.TestCase): tmp = self.getFRRconfig(f'interface {dummy_if}', stop_section='^exit') self.assertIn(f' openfabric password clear {password}-{dummy_if}', tmp) + # Switch to MD5 passwords - delete plaintext passwords first + self.cli_delete(path + ['domain-password', 'plaintext-password']) + self.cli_delete(path + ['interface', dummy_if, 'password', 'plaintext-password']) + + self.cli_set(path + ['domain-password', 'md5', md5_password]) + self.cli_set(path + ['interface', dummy_if, 'password', 'md5', md5_password]) + + # Commit all changes + self.cli_commit() + + # Verify all changes + tmp = self.getFRRconfig(f'router openfabric {domain}', stop_section='^exit') + self.assertIn(f' domain-password md5 {md5_password}', tmp) + + tmp = self.getFRRconfig(f'interface {dummy_if}', stop_section='^exit') + self.assertIn(f' openfabric password md5 {md5_password}', tmp) + def test_openfabric_multiple_domains(self): domain_2 = 'VyOS_2' interface = 'dum5678' |
