Skip to content

Commit

Permalink
Merge pull request #12896 from Mab879/fix_12893
Browse files Browse the repository at this point in the history
Update tests for file_groupownership_sshd_private_key
  • Loading branch information
jan-cerny authored Jan 27, 2025
2 parents 4680a0c + abc3519 commit 7f8944c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
# platform = multi_platform_ol,multi_platform_rhel
{{% set dedicated_ssh_groupname = groups.get("dedicated_ssh_keyowner", {}).get("name", "root") %}}

if ! grep -q ssh_keys /etc/group; then
groupadd ssh_keys
if ! grep -q "{{{ dedicated_ssh_groupname }}}" /etc/group; then
groupadd "{{{ dedicated_ssh_groupname }}}"
fi

FAKE_KEY=$(mktemp -p /etc/ssh/ XXXX_key)
chgrp ssh_keys "$FAKE_KEY"
chgrp "{{{ dedicated_ssh_groupname }}}" "$FAKE_KEY"
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
# platform = multi_platform_ol,multi_platform_rhel
{{% set dedicated_ssh_groupname = groups.get("dedicated_ssh_keyowner", {}).get("name", "root") %}}

test_group="cac_testgroup"
groupadd $test_group

FAKE_KEY=$(mktemp -p /etc/ssh/ XXXX_key)
chgrp ssh_keys "$FAKE_KEY"
chgrp {{{ dedicated_ssh_groupname }}} "$FAKE_KEY"

FAKE_KEY2=$(mktemp -p /etc/ssh/ XXXX_key)
chgrp $test_group "$FAKE_KEY2"

0 comments on commit 7f8944c

Please sign in to comment.