pgbackrest.git / summary / log / commit / refs

commit    c69baa2de1ed4d00a87f90634c347e730f3babc3
Author:   David Steele <david@pgmasters.net>
Date:     Wed Jun 21 20:51:41 2017 +0000

    Install sudo in base containers rather than on demand.


doc/xml/release.xml | 4 ++++ test/lib/pgBackRestTest/Common/ContainerTest.pm | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 16dc456ec..34563493d 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -202,6 +202,10 @@ <release-item> <p>Eliminate redundancy in <id>real</id> tests.</p> </release-item> + + <release-item> + <p>Install <id>sudo</id> in base containers rather than on demand.</p> + </release-item> </release-refactor-list> </release-test-list> </release> diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm index dee3cd453..faae5e61d 100755 --- a/test/lib/pgBackRestTest/Common/ContainerTest.pm +++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm @@ -249,15 +249,13 @@ sub sudoSetup if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL) { $strScript .= - "\nRUN yum -y install sudo && \\" . - "\n echo '%${strGroup} ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/${strGroup} && \\" . + "\nRUN echo '%${strGroup} ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/${strGroup} && \\" . "\n sed -i 's/^Defaults requiretty\$/\\# Defaults requiretty/' /etc/sudoers"; } elsif ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_DEBIAN) { $strScript .= - "\nRUN apt-get -y install sudo && \\" . - "\n echo '%${strGroup} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"; + "\nRUN echo '%${strGroup} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"; } else { @@ -501,13 +499,13 @@ sub containerBuild if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL) { - $strScript .= "RUN yum -y install openssh-server openssh-clients wget\n"; + $strScript .= "RUN yum -y install openssh-server openssh-clients wget sudo\n"; } elsif ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_DEBIAN) { $strScript .= "RUN apt-get update && \\\n" . - " apt-get -y install openssh-server wget vim net-tools iputils-ping\n"; + " apt-get -y install openssh-server wget vim net-tools iputils-ping sudo\n"; $strScript .= "\n# Fix root tty\n" . [parent: 64ec7eb49077]