summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Falcon <therealfalcon@gmail.com>2021-08-23 16:50:40 -0500
committerGitHub <noreply@github.com>2021-08-23 15:50:40 -0600
commit6803368dec44c8b42196931b3a42d014a10b600d (patch)
tree703d73556cc5e4423ec5da9d912a7e0591dd0afc
parent03ee10cd378773fab50eacf6fce3c55e8f828879 (diff)
downloadcloud-init-git-6803368dec44c8b42196931b3a42d014a10b600d.tar.gz
testing: Fix ssh keys integration test (#992)
Home directory permissions changed in hirsute. The integration test assumed permissions from earlier releases. Test was fixed to take both permissions into account
-rw-r--r--tests/integration_tests/modules/test_ssh_keysfile.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/integration_tests/modules/test_ssh_keysfile.py b/tests/integration_tests/modules/test_ssh_keysfile.py
index 3159feb9..5c720578 100644
--- a/tests/integration_tests/modules/test_ssh_keysfile.py
+++ b/tests/integration_tests/modules/test_ssh_keysfile.py
@@ -3,6 +3,7 @@ import pytest
from io import StringIO
from paramiko.ssh_exception import SSHException
+from tests.integration_tests.clouds import ImageSpecification
from tests.integration_tests.instances import IntegrationInstance
from tests.integration_tests.util import get_test_rsa_keypair
@@ -77,7 +78,12 @@ def common_verify(client, expected_keys):
# Ensure we haven't messed with any /home permissions
# See LP: #1940233
home_dir = '/home/{}'.format(user)
- home_perms = '755'
+ # Home permissions aren't consistent between releases. On ubuntu
+ # this can change to 750 once focal is unsupported.
+ if ImageSpecification.from_os_image().release in ("bionic", "focal"):
+ home_perms = '755'
+ else:
+ home_perms = '750'
if user == 'root':
home_dir = '/root'
home_perms = '700'