summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_ssh.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-17 13:45:03 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-17 13:45:24 +0100
commit70ae542e3ead29869576788377a3fc8d2a0cc473 (patch)
tree64fde3cd96d01b3eaff320e1c578d9c5bbcbf8e5 /smoketest/scripts/cli/test_service_ssh.py
parent82ad19cc868fbdbcd212dd47ee8148333db1d4a0 (diff)
downloadvyos-1x-70ae542e3ead29869576788377a3fc8d2a0cc473.tar.gz
vyos-1x-70ae542e3ead29869576788377a3fc8d2a0cc473.zip
ssh: T671: generate rsa, dsa and ed25519 keys on demand
Diffstat (limited to 'smoketest/scripts/cli/test_service_ssh.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_ssh.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_ssh.py b/smoketest/scripts/cli/test_service_ssh.py
index 1e099b0a5..68081e56f 100755
--- a/smoketest/scripts/cli/test_service_ssh.py
+++ b/smoketest/scripts/cli/test_service_ssh.py
@@ -29,6 +29,10 @@ SSHD_CONF = '/run/sshd/sshd_config'
base_path = ['service', 'ssh']
vrf = 'mgmt'
+key_rsa = '/etc/ssh/ssh_host_rsa_key'
+key_dsa = '/etc/ssh/ssh_host_dsa_key'
+key_ed25519 = '/etc/ssh/ssh_host_ed25519_key'
+
def get_config_value(key):
tmp = read_file(SSHD_CONF)
tmp = re.findall(f'\n?{key}\s+(.*)', tmp)
@@ -47,6 +51,10 @@ class TestServiceSSH(unittest.TestCase):
self.session.commit()
del self.session
+ self.assertTrue(os.path.isfile(key_rsa))
+ self.assertTrue(os.path.isfile(key_dsa))
+ self.assertTrue(os.path.isfile(key_ed25519))
+
def test_ssh_default(self):
# Check if SSH service runs with default settings - used for checking
# behavior of <defaultValue> in XML definition