pgbackrest.git / summary / log / commit / refs

commit    d24180e4da49a8e2ef2a10a02e76cd204fe1ae8f
Author:   David Steele <david@pgmasters.net>
Date:     Tue Aug 29 16:28:02 2023 +0000

    Fix conflicting group in test containers.
    
    The tests expect the group name/id to match between the host system and the container. If there is a conflict rename the group with the required id to the expected name.
    
    This could have unintended consequences but it seems reasonably safe since we control everything that runs in the container and there should never be any system processes running.


test/lib/pgBackRestTest/Common/ContainerTest.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm index 6765c638e..70f434f8b 100644 --- a/test/lib/pgBackRestTest/Common/ContainerTest.pm +++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm @@ -617,6 +617,12 @@ sub containerBuild " echo 'PubkeyAcceptedAlgorithms=+ssh-rsa,ssh-rsa-cert-v01\@openssh.com' >> /etc/ssh/sshd_config"; } + # Rename existing group that would conflict with our group name. This is pretty hacky but should be OK since we are the + # only thing running in the container. + $strScript .= sectionHeader() . + "# Rename conflicting group\n" . + ' sed -i s/.*\:x\:' . TEST_GROUP_ID . '\:$/' . TEST_GROUP . '\:x\:' . TEST_GROUP_ID . "\:/ /etc/group"; + $strScript .= sectionHeader() . "# Create test user\n" . ' ' . groupCreate($strOS, TEST_GROUP, TEST_GROUP_ID) . " && \\\n" . [parent: 1e6efd73e1fc]