diff --git a/docker/tests/Templates/centos7/Dockerfile b/docker/tests/Templates/centos7/Dockerfile index afb73c746e..4293e00ec6 100644 --- a/docker/tests/Templates/centos7/Dockerfile +++ b/docker/tests/Templates/centos7/Dockerfile @@ -1,7 +1,6 @@ FROM centos:7 ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git @@ -17,7 +16,7 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG -RUN curl -L -o powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm -RUN yum install -y powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm +RUN curl -L -o powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm +RUN yum install -y powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm RUN git clone --recursive $GITLOCATION RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" diff --git a/docker/tests/Templates/debian.8/Dockerfile b/docker/tests/Templates/debian.8/Dockerfile index 8ae8f645f7..141280b8f5 100644 --- a/docker/tests/Templates/debian.8/Dockerfile +++ b/docker/tests/Templates/debian.8/Dockerfile @@ -1,7 +1,6 @@ FROM debian:jessie ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git diff --git a/docker/tests/Templates/debian.9/Dockerfile b/docker/tests/Templates/debian.9/Dockerfile index 500f4665a0..bba1da3974 100644 --- a/docker/tests/Templates/debian.9/Dockerfile +++ b/docker/tests/Templates/debian.9/Dockerfile @@ -1,7 +1,6 @@ FROM debian:stretch ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git diff --git a/docker/tests/Templates/fedora26/Dockerfile b/docker/tests/Templates/fedora26/Dockerfile index 906101d7f4..197d406d51 100644 --- a/docker/tests/Templates/fedora26/Dockerfile +++ b/docker/tests/Templates/fedora26/Dockerfile @@ -1,7 +1,6 @@ FROM fedora:26 ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git @@ -18,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 powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm -RUN dnf install -y powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm +RUN curl -L -o powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm +RUN dnf install -y powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm RUN git clone --recursive $GITLOCATION RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" diff --git a/docker/tests/Templates/fedora27/Dockerfile b/docker/tests/Templates/fedora27/Dockerfile index 2e27dee63a..1ee2d98c9d 100644 --- a/docker/tests/Templates/fedora27/Dockerfile +++ b/docker/tests/Templates/fedora27/Dockerfile @@ -1,7 +1,6 @@ FROM fedora:27 ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git @@ -17,7 +16,7 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG -RUN curl -L -o powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm -RUN dnf install -y powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm +RUN curl -L -o powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm +RUN dnf install -y powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm RUN git clone --recursive $GITLOCATION RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" diff --git a/docker/tests/Templates/kalilinux/Dockerfile b/docker/tests/Templates/kalilinux/Dockerfile index 58e447102e..a10bd0693d 100644 --- a/docker/tests/Templates/kalilinux/Dockerfile +++ b/docker/tests/Templates/kalilinux/Dockerfile @@ -1,7 +1,6 @@ FROM kalilinux/kali-linux-docker:latest ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git diff --git a/docker/tests/Templates/opensuse42.2/Dockerfile b/docker/tests/Templates/opensuse42.2/Dockerfile index 33f38b310f..5389e11af4 100644 --- a/docker/tests/Templates/opensuse42.2/Dockerfile +++ b/docker/tests/Templates/opensuse42.2/Dockerfile @@ -1,7 +1,6 @@ FROM opensuse:42.2 ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git diff --git a/docker/tests/Templates/ubuntu14.04/Dockerfile b/docker/tests/Templates/ubuntu14.04/Dockerfile index 5a5c54f621..bc22e9fefc 100644 --- a/docker/tests/Templates/ubuntu14.04/Dockerfile +++ b/docker/tests/Templates/ubuntu14.04/Dockerfile @@ -1,7 +1,6 @@ FROM ubuntu:trusty ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git diff --git a/docker/tests/Templates/ubuntu16.04/Dockerfile b/docker/tests/Templates/ubuntu16.04/Dockerfile index a20171a33f..521e071612 100644 --- a/docker/tests/Templates/ubuntu16.04/Dockerfile +++ b/docker/tests/Templates/ubuntu16.04/Dockerfile @@ -1,7 +1,6 @@ FROM ubuntu:xenial ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git diff --git a/docker/tests/Templates/ubuntu17.10/Dockerfile b/docker/tests/Templates/ubuntu17.10/Dockerfile index c698589e7c..8855386733 100644 --- a/docker/tests/Templates/ubuntu17.10/Dockerfile +++ b/docker/tests/Templates/ubuntu17.10/Dockerfile @@ -1,7 +1,6 @@ FROM ubuntu:artful ARG PSVERSIONSTUB=6.0.2 -ARG PSVERSIONSTUBRPM=6.0.2 ARG PACKAGELOCATIONSTUB ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index bad8c4bfe4..afa1c80d2d 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -224,7 +224,7 @@ function Test-PSPackage [Parameter(Mandatory=$true)] $PSPackageLocation, # e.g. Azure storage [string] - $PSVersion = "6.0.2", + $PSVersion = "6.0.2", # e.g. "6.1.0~preview.2" [string] $TestList = "/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module", [string] @@ -246,8 +246,6 @@ function Test-PSPackage Copy-Item -Recurse $SourceFolder $RootFolder - $versionRpmStubName = 'PSVERSIONSTUBRPM' - $versionRpmStubValue = $PSVersion -replace '-','_' $versionStubName = 'PSVERSIONSTUB' $versionStubValue = $PSVersion $testlistStubName = 'TESTLISTSTUB' @@ -264,8 +262,17 @@ function Test-PSPackage foreach($dir in Get-ChildItem -Path $RootFolder) { $buildArgs = @() - $buildArgs += "--build-arg","$versionRpmStubName=$versionRpmStubValue" - $buildArgs += "--build-arg","$versionStubName=$versionStubValue" + + if ($dir.Name -eq "opensuse42.2") # special cases that use dash instead of tilda as preview separator, e.g. 'powershell-6.1.0-preview.2-linux-x64.tar.gz' + { + $versionStubDashValue = $PSVersion -replace '~','-' + $buildArgs += "--build-arg","$versionStubName=$versionStubDashValue" + } + else # majority of configurations - they use tilda as preview separator, e.g. 'powershell-6.1.0~preview.2-1.rhel.7.x86_64.rpm' + { + $buildArgs += "--build-arg","$versionStubName=$versionStubValue" + } + $buildArgs += "--build-arg","$testlistStubName=$testlistStubValue" $buildArgs += "--build-arg","$packageLocationStubName=$packageLocationStubValue" $buildArgs += "--build-arg","$GitLocationStubName=$GitLocationStubValue"