-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12896 from Mab879/fix_12893
Update tests for file_groupownership_sshd_private_key
- Loading branch information
Showing
2 changed files
with
6 additions
and
4 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
.../guide/services/ssh/file_groupownership_sshd_private_key/tests/correct_groupowner.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
3 changes: 2 additions & 1 deletion
3
linux_os/guide/services/ssh/file_groupownership_sshd_private_key/tests/multiple_keys.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |