From 503fb7fb33b8c3758a50bd5dcfbcd907d4a8719b Mon Sep 17 00:00:00 2001 From: khramshinr Date: Tue, 25 Jun 2024 16:37:16 +0600 Subject: ssh: T5878: Allow changing the PubkeyAcceptedAlgorithms option (cherry picked from commit 06e6e011cdf12e8d10cf1f6d4d848fd5db51720d) --- smoketest/scripts/cli/test_service_ssh.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'smoketest/scripts') diff --git a/smoketest/scripts/cli/test_service_ssh.py b/smoketest/scripts/cli/test_service_ssh.py index b09990c92..d8e325eee 100755 --- a/smoketest/scripts/cli/test_service_ssh.py +++ b/smoketest/scripts/cli/test_service_ssh.py @@ -304,6 +304,22 @@ class TestServiceSSH(VyOSUnitTestSHIM.TestCase): for line in ssh_lines: self.assertIn(line, tmp_sshd_conf) + def test_ssh_pubkey_accepted_algorithm(self): + algs = ['ssh-ed25519', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', + 'ecdsa-sha2-nistp521', 'ssh-dss', 'ssh-rsa', 'rsa-sha2-256', + 'rsa-sha2-512' + ] + + expected = 'PubkeyAcceptedAlgorithms ' + for alg in algs: + self.cli_set(base_path + ['pubkey-accepted-algorithm', alg]) + expected = f'{expected}{alg},' + expected = expected[:-1] + + self.cli_commit() + tmp_sshd_conf = read_file(SSHD_CONF) + self.assertIn(expected, tmp_sshd_conf) + if __name__ == '__main__': unittest.main(verbosity=2) -- cgit v1.2.3