From 9eb5587d07473435231d2177b10dd471712fef0c Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Tue, 6 Aug 2019 17:17:15 -0400 Subject: [PATCH] Cleanup Docker release testing (#10310) --- docker/InstallTarballPackage.sh | 11 ++++------- docker/tests/README.md | 2 +- docker/tests/Templates/centos7/Dockerfile | 4 ++-- .../Templates/fxdependent-dotnetsdk-latest/Dockerfile | 4 ++-- .../tests/Templates/fxdependent-fedora28/Dockerfile | 4 ++-- .../Templates/fxdependent-ubuntu16.04/Dockerfile | 4 ++-- .../Templates/fxdependent-ubuntu18.04/Dockerfile | 4 ++-- docker/tests/containerTestCommon.psm1 | 3 +-- 8 files changed, 16 insertions(+), 20 deletions(-) diff --git a/docker/InstallTarballPackage.sh b/docker/InstallTarballPackage.sh index 1bc807a0b..08c7923c6 100644 --- a/docker/InstallTarballPackage.sh +++ b/docker/InstallTarballPackage.sh @@ -3,24 +3,21 @@ # Exit on errors set -e -# # Example use: # ./InstallTarballPackage.sh "6.0.0-beta.9" "powershell-6.0.0-beta.9-linux-x64.tar.gz" -# + usage() { echo "usage: $0 " exit 1 } POWERSHELL_VERSION=$1 -if [ ! "$POWERSHELL_VERSION" ] -then +if [ ! "$POWERSHELL_VERSION" ]; then usage fi POWERSHELL_PACKAGE=$2 -if [ ! "$POWERSHELL_PACKAGE" ] -then +if [ ! "$POWERSHELL_PACKAGE" ]; then usage fi @@ -37,7 +34,7 @@ tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/$POWERSHELL_VERSION # Create the symbolic link that points to powershell ln -s /opt/microsoft/powershell/$POWERSHELL_VERSION/pwsh $POWERSHELL_LINKFILE # Add the symbolic link path to /etc/shells -if [ ! -f /etc/shells ] ; then +if [ ! -f /etc/shells ]; then echo $POWERSHELL_LINKFILE > /etc/shells ; else grep -q "^${POWERSHELL_LINKFILE}$" /etc/shells || echo $POWERSHELL_LINKFILE >> /etc/shells ; diff --git a/docker/tests/README.md b/docker/tests/README.md index f43ec7b51..716a7d6f6 100644 --- a/docker/tests/README.md +++ b/docker/tests/README.md @@ -10,7 +10,7 @@ The tests must be run separately on the Windows and Linux docker daemons. You ca Invoke-Pester ``` -Note: be sure to do this using both the Windows and Linux docker daemon, as the windows. +Note: be sure to do this using both the Windows and Linux docker daemon. ## To test the productions containers diff --git a/docker/tests/Templates/centos7/Dockerfile b/docker/tests/Templates/centos7/Dockerfile index 1de7fdf04..dddf24394 100644 --- a/docker/tests/Templates/centos7/Dockerfile +++ b/docker/tests/Templates/centos7/Dockerfile @@ -17,7 +17,7 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG -RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME -RUN yum install -y $PACKAGENAME +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME \ + && yum install -y $PACKAGENAME RUN $TESTDOWNLOADCOMMAND RUN pwsh$PREVIEWSUFFIX -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-dotnetsdk-latest/Dockerfile b/docker/tests/Templates/fxdependent-dotnetsdk-latest/Dockerfile index bd61efbf6..cf56e4ec0 100644 --- a/docker/tests/Templates/fxdependent-dotnetsdk-latest/Dockerfile +++ b/docker/tests/Templates/fxdependent-dotnetsdk-latest/Dockerfile @@ -23,8 +23,8 @@ RUN locale-gen $LANG && update-locale # Install PowerShell package ADD $PACKAGELOCATION/$PACKAGENAME . -RUN mkdir -p /opt/microsoft/powershell -RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell +RUN mkdir -p /opt/microsoft/powershell \ + && tar zxf $PACKAGENAME -C /opt/microsoft/powershell # Download and run tests RUN $TESTDOWNLOADCOMMAND diff --git a/docker/tests/Templates/fxdependent-fedora28/Dockerfile b/docker/tests/Templates/fxdependent-fedora28/Dockerfile index a654fa9c0..6acb74524 100644 --- a/docker/tests/Templates/fxdependent-fedora28/Dockerfile +++ b/docker/tests/Templates/fxdependent-fedora28/Dockerfile @@ -30,8 +30,8 @@ RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG # Install PowerShell package ADD $PACKAGELOCATION/$PACKAGENAME . -RUN mkdir -p /opt/microsoft/powershell -RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell +RUN mkdir -p /opt/microsoft/powershell \ + && tar zxf $PACKAGENAME -C /opt/microsoft/powershell # Download and run tests RUN $TESTDOWNLOADCOMMAND diff --git a/docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile b/docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile index 4964c9613..aa976ddb1 100644 --- a/docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile +++ b/docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile @@ -31,8 +31,8 @@ RUN locale-gen $LANG && update-locale # Install PowerShell package ADD $PACKAGELOCATION/$PACKAGENAME . -RUN mkdir -p /opt/microsoft/powershell -RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell +RUN mkdir -p /opt/microsoft/powershell \ + && tar zxf $PACKAGENAME -C /opt/microsoft/powershell # Download and run tests RUN $TESTDOWNLOADCOMMAND diff --git a/docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile b/docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile index acec24a0f..adc9219a0 100644 --- a/docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile +++ b/docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile @@ -23,8 +23,8 @@ RUN locale-gen $LANG && update-locale # Install PowerShell package ADD $PACKAGELOCATION/$PACKAGENAME . -RUN mkdir -p /opt/microsoft/powershell -RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell +RUN mkdir -p /opt/microsoft/powershell \ + && tar zxf $PACKAGENAME -C /opt/microsoft/powershell # Download and run tests RUN $TESTDOWNLOADCOMMAND diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index 3b1dd767b..4816812b6 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -75,7 +75,6 @@ function Get-LinuxContainer Path = "$psscriptroot/../release/$os" } } - } # Return a list of Windows Container Test Cases @@ -130,7 +129,7 @@ function Test-SkipLinux return $true } default { - throw "Unknow docker os '$os'" + throw "Unknown docker os '$os'" } } }