Skip to content

Commit

Permalink
Merge pull request #508 from zhaohuijuan/dev
Browse files Browse the repository at this point in the history
Update case test_check_hostkey_permissions to adapt the bootc scenario
  • Loading branch information
zhaohuijuan authored Jan 14, 2025
2 parents 11f3b87 + f5e9eb3 commit 5a34ae2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions os_tests/tests/test_cloud_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,9 +1317,14 @@ def test_check_hostkey_permissions(self):
if 'ssh_keys' in group_ssh_keys:
for key in private_keys:
if len(key) == 0:
continue
self.assertIn('-rw-r-----. root ssh_keys', key,
continue
ssh_ver = utils_lib.run_cmd(self, "rpm -q openssh | awk -F'-' '{print $2}' | awk -F'p' '{print $1}'")
if float(ssh_ver) > 9:
self.assertIn('-rw-------. root ssh_keys', key,
msg=" Unexpected permissions -> %s" % key)
else:
self.assertIn('-rw-r-----. root ssh_keys', key,
msg=" Unexpected permissions -> %s" % key)
else:
for key in private_keys:
if len(key) == 0:
Expand Down

0 comments on commit 5a34ae2

Please sign in to comment.