Skip to content

Commit

Permalink
Move tests to use the correct ssh group based on the OS
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Jan 24, 2025
1 parent b02253c commit abc3519
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 abc3519

Please sign in to comment.