From 005b502b93c330c4e25c024c71ebcd03bc699d8d Mon Sep 17 00:00:00 2001 From: JumpingYang001 Date: Tue, 21 Feb 2017 01:40:20 -0800 Subject: [PATCH 1/6] Update Pester test for PSRP --- test/installPSRP.sh | 16 +++++++++------- test/installpowershell.sh | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/test/installPSRP.sh b/test/installPSRP.sh index d26a946..82582f3 100755 --- a/test/installPSRP.sh +++ b/test/installPSRP.sh @@ -8,7 +8,7 @@ trap ' ' INT if [ $# -ne 3 ]; then - echo -e "Need redmondpassword with omiversion and psrpversion\nUsage:installPSRP.sh redmondpassword \"1.1.0-63\" \"6\"" + echo -e "Need redmondpassword with omiversion and psrpversion\nUsage:installPSRP.sh redmondpassword \"1.2.0-23\" \"13\"" exit 2 fi @@ -19,8 +19,8 @@ redmondpassword=$1 isMacOS=false omiversion=$2 psrpversion=$3 -powershellDir="/opt/microsoft/powershell/6.0.0-alpha.14" -powershellDirForMac="/usr/local/microsoft/powershell/6.0.0-alpha.14" +powershellDir="/opt/microsoft/powershell/6.0.0-alpha.16" +powershellDirForMac="/usr/local/microsoft/powershell/6.0.0-alpha.16" realdataDir="//osfiler/ostcdata$" get_omifolder() { echo "/download/OSTCData/Builds/omi/develop/$1/$2/$3" @@ -117,7 +117,8 @@ if [ "$isMacOS" = "true" ]; then # Mac OS don't have mount_cifs, so use mount_smbfs omifolder=$(get_omifolder "$omiversion" "$platfrom" "$opensslversion") echo "mounting from $realdataDir folder to omi folder: $omifolder" - sudo mount -t smbfs '//redmond.corp.microsoft.com;scxsvc:'"$redmondpassword"'@osfiler/ostcdata$' /download + #sudo mount -t smbfs '//redmond.corp.microsoft.com;scxsvc:'"$redmondpassword"'@osfiler/ostcdata$' /download + sudo mount osfiler.scx.com:/OSTCData/OSTCData /download sudo cp -f $omifolder"omicli" /opt/omi/bin sudo cp -f $omifolder"libmi.dylib" /opt/omi/lib #sudo cp -f $omifolder"libmi.dylib" $powershellDir @@ -125,7 +126,8 @@ if [ "$isMacOS" = "true" ]; then psrpfolder=$(get_psrpfolder "$psrpversion" "$platfrom") echo "mounting from $realdataDir folder to psrp folder: $psrpfolder" - sudo mount -t smbfs '//redmond.corp.microsoft.com;scxsvc:'"$redmondpassword"'@osfiler/ostcdata$' /download + #sudo mount -t smbfs '//redmond.corp.microsoft.com;scxsvc:'"$redmondpassword"'@osfiler/ostcdata$' /download + sudo mount osfiler.scx.com:/OSTCData/OSTCData /download echo "Copying psrpclient ..." sudo cp -f $psrpfolder/libpsrpclient.dylib $powershellDir sudo umount /download @@ -171,7 +173,7 @@ case "$OSTYPE" in #echo "Copying omicli and psrpclient ..." #libmi.so and libpsrpclient.so are integrated into powershell package, so needn't to copy them from build share folder #sudo cp -u libmi.so $powershellDir - #sudo cp -u libpsrpclient.so $powershellDir + sudo cp -u libpsrpclient.so $powershellDir ;; ubuntu) # dpkg does not automatically resolve dependencies, but spouts ugly errors @@ -194,7 +196,7 @@ case "$OSTYPE" in #echo "Copying omicli and psrpclient ..." #libmi.so and libpsrpclient.so are integrated into powershell package, so needn't to copy them from build share folder #sudo cp -u libmi.so $powershellDir - #sudo cp -u libpsrpclient.so $powershellDir + sudo cp -u libpsrpclient.so $powershellDir # Resolve dependencies sudo apt-get install -f -y ;; diff --git a/test/installpowershell.sh b/test/installpowershell.sh index 0173832..5a1c043 100644 --- a/test/installpowershell.sh +++ b/test/installpowershell.sh @@ -7,10 +7,10 @@ trap ' kill -s INT "$$" ' INT -releaseversion="6.0.0-alpha.14" -centosreleaseversion="6.0.0_alpha.14" +releaseversion="6.0.0-alpha.16" +centosreleaseversion="6.0.0_alpha.16" get_url() { - release=v6.0.0-alpha.14 + release=v6.0.0-alpha.16 echo "https://github.com/PowerShell/PowerShell/releases/download/$release/$1" } From 7b2342dba9c6646c597872ba4dd075a52aa7aed1 Mon Sep 17 00:00:00 2001 From: JumpingYang001 Date: Thu, 23 Feb 2017 23:11:43 -0800 Subject: [PATCH 2/6] Update fixes for PSRP Pester test --- test/installPSRP.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) mode change 100755 => 100644 test/installPSRP.sh diff --git a/test/installPSRP.sh b/test/installPSRP.sh old mode 100755 new mode 100644 index 82582f3..96aeef8 --- a/test/installPSRP.sh +++ b/test/installPSRP.sh @@ -171,8 +171,7 @@ case "$OSTYPE" in echo "Done installing psrp ..." #echo "Copying omicli and psrpclient ..." - #libmi.so and libpsrpclient.so are integrated into powershell package, so needn't to copy them from build share folder - #sudo cp -u libmi.so $powershellDir + sudo cp -u libmi.so $powershellDir sudo cp -u libpsrpclient.so $powershellDir ;; ubuntu) @@ -194,8 +193,7 @@ case "$OSTYPE" in echo "Done installing psrp ..." #echo "Copying omicli and psrpclient ..." - #libmi.so and libpsrpclient.so are integrated into powershell package, so needn't to copy them from build share folder - #sudo cp -u libmi.so $powershellDir + sudo cp -u libmi.so $powershellDir sudo cp -u libpsrpclient.so $powershellDir # Resolve dependencies sudo apt-get install -f -y From be3185a4deb2230f7236c91acdfef41f374cd530 Mon Sep 17 00:00:00 2001 From: JumpingYang001 Date: Thu, 2 Mar 2017 20:28:55 -0800 Subject: [PATCH 3/6] Update fixes for OMI/PSRP tests --- test/build.psm1 | 4 +++- test/installPSRP.sh | 6 +++--- test/installpowershell.sh | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/build.psm1 b/test/build.psm1 index 8fa7f4b..dced9c4 100644 --- a/test/build.psm1 +++ b/test/build.psm1 @@ -13,7 +13,9 @@ function Start-PSRPInstall { [ValidateSet("win7-x64", "win7-x86", "win81-x64", - "win10-x64")] + "win10-x64", + "WS2012R2-x64", + "WS2016-x64")] [Parameter(ParameterSetName='CoreCLR')] [string]$Runtime ) diff --git a/test/installPSRP.sh b/test/installPSRP.sh index 96aeef8..f380d52 100644 --- a/test/installPSRP.sh +++ b/test/installPSRP.sh @@ -118,16 +118,16 @@ if [ "$isMacOS" = "true" ]; then omifolder=$(get_omifolder "$omiversion" "$platfrom" "$opensslversion") echo "mounting from $realdataDir folder to omi folder: $omifolder" #sudo mount -t smbfs '//redmond.corp.microsoft.com;scxsvc:'"$redmondpassword"'@osfiler/ostcdata$' /download - sudo mount osfiler.scx.com:/OSTCData/OSTCData /download + sudo mount osfiler.scx.com:/OSTCData /download sudo cp -f $omifolder"omicli" /opt/omi/bin sudo cp -f $omifolder"libmi.dylib" /opt/omi/lib - #sudo cp -f $omifolder"libmi.dylib" $powershellDir + sudo cp -f $omifolder"libmi.dylib" $powershellDir sudo umount /download psrpfolder=$(get_psrpfolder "$psrpversion" "$platfrom") echo "mounting from $realdataDir folder to psrp folder: $psrpfolder" #sudo mount -t smbfs '//redmond.corp.microsoft.com;scxsvc:'"$redmondpassword"'@osfiler/ostcdata$' /download - sudo mount osfiler.scx.com:/OSTCData/OSTCData /download + sudo mount osfiler.scx.com:/OSTCData /download echo "Copying psrpclient ..." sudo cp -f $psrpfolder/libpsrpclient.dylib $powershellDir sudo umount /download diff --git a/test/installpowershell.sh b/test/installpowershell.sh index 5a1c043..7db6c7c 100644 --- a/test/installpowershell.sh +++ b/test/installpowershell.sh @@ -84,7 +84,7 @@ case "$OSTYPE" in # dpkg does not automatically resolve dependencies, but spouts ugly errors sudo dpkg -i "./$package" &> /dev/null # Resolve dependencies - sudo apt-get install -f + sudo apt-get install -fy ;; *) esac From ab1e7d2f75e2438f18edac379291dc2bbf2f4a61 Mon Sep 17 00:00:00 2001 From: JumpingYang001 Date: Thu, 2 Mar 2017 20:46:23 -0800 Subject: [PATCH 4/6] Update PSRPVersion in package name for Pester test --- test/installPSRP.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/installPSRP.sh b/test/installPSRP.sh index f380d52..714e9cc 100644 --- a/test/installPSRP.sh +++ b/test/installPSRP.sh @@ -162,7 +162,7 @@ case "$OSTYPE" in sudo rpm -i "./$omipackage" echo "Done installing omi ..." - psrppackage=psrp-1.0.0-0.universal.x64.rpm + psrppackage=psrp-1.0.0-$psrpversion.universal.x64.rpm if [[ ! -r "$psrppackage" ]]; then echo "ERROR: $psrppackage failed to download! Aborting..." >&2 exit 1 @@ -184,7 +184,7 @@ case "$OSTYPE" in sudo dpkg -i "./$omipackage" echo "Done installing omi ..." - psrppackage=psrp-1.0.0-0.universal.x64.deb + psrppackage=psrp-1.0.0-$psrpversion.universal.x64.deb if [[ ! -r "$psrppackage" ]]; then echo "ERROR: $psrppackage failed to download! Aborting..." >&2 exit 1 From c15629288959504dc357a3d2cba00e404cf1dbd2 Mon Sep 17 00:00:00 2001 From: JumpingYang001 Date: Thu, 2 Mar 2017 21:54:42 -0800 Subject: [PATCH 5/6] Add some information to display in output of test install script --- test/installPSRP.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/installPSRP.sh b/test/installPSRP.sh index 714e9cc..1e09688 100644 --- a/test/installPSRP.sh +++ b/test/installPSRP.sh @@ -8,7 +8,7 @@ trap ' ' INT if [ $# -ne 3 ]; then - echo -e "Need redmondpassword with omiversion and psrpversion\nUsage:installPSRP.sh redmondpassword \"1.2.0-23\" \"13\"" + echo -e "Need redmondpassword with omiversion and psrpversion\nUsage:installPSRP.sh redmondpassword \"1.2.0-35\" \"18\"" exit 2 fi @@ -72,7 +72,7 @@ case "$OSTYPE" in platfrom=Linux_ULINUX_1.0_x64_64_Release ;; *) - echo "Ubuntu $VERSION_ID is not supported!" >&2 + echo "Ubuntu $VERSION_ID is not supported!" exit 2 esac @@ -83,7 +83,7 @@ case "$OSTYPE" in esac ;; *) - echo "$NAME is not supported!" >&2 + echo "$NAME is not supported!" exit 2 esac ;; @@ -95,7 +95,7 @@ case "$OSTYPE" in powershellDir=$powershellDirForMac ;; *) - echo "$OSTYPE is not supported!" >&2 + echo "$OSTYPE is not supported!" exit 2 ;; esac @@ -156,7 +156,7 @@ case "$OSTYPE" in # yum automatically resolves dependencies for local packages omipackage=omi-$omiversion.ulinux.x64.rpm if [[ ! -r "$omipackage" ]]; then - echo "ERROR: $omipackage failed to download! Aborting..." >&2 + echo "ERROR: $omipackage failed to download! Aborting..." exit 1 fi sudo rpm -i "./$omipackage" @@ -164,7 +164,7 @@ case "$OSTYPE" in psrppackage=psrp-1.0.0-$psrpversion.universal.x64.rpm if [[ ! -r "$psrppackage" ]]; then - echo "ERROR: $psrppackage failed to download! Aborting..." >&2 + echo "ERROR: $psrppackage failed to download! Aborting..." exit 1 fi sudo rpm -i "./$psrppackage" @@ -178,7 +178,7 @@ case "$OSTYPE" in # dpkg does not automatically resolve dependencies, but spouts ugly errors omipackage=omi-$omiversion.ulinux.x64.deb if [[ ! -r "$omipackage" ]]; then - echo "ERROR: $omipackage failed to download! Aborting..." >&2 + echo "ERROR: $omipackage failed to download! Aborting..." exit 1 fi sudo dpkg -i "./$omipackage" @@ -186,10 +186,10 @@ case "$OSTYPE" in psrppackage=psrp-1.0.0-$psrpversion.universal.x64.deb if [[ ! -r "$psrppackage" ]]; then - echo "ERROR: $psrppackage failed to download! Aborting..." >&2 + echo "ERROR: $psrppackage failed to download! Aborting..." exit 1 fi - sudo dpkg -i "./$psrppackage" &> /dev/null + sudo dpkg -i "./$psrppackage" echo "Done installing psrp ..." #echo "Copying omicli and psrpclient ..." @@ -208,7 +208,7 @@ esac success=$? if [[ "$success" != 0 ]]; then - echo "OMI and PSRP install failed." >&2 + echo "OMI and PSRP install failed." exit "$success" else echo "Congratulations! OMI and PSRP are installed." From f791ca35e3112446e118534851ccaa0ebb5b8a7f Mon Sep 17 00:00:00 2001 From: JumpingYang001 Date: Fri, 3 Mar 2017 02:27:41 -0800 Subject: [PATCH 6/6] Update build.psm1 for windows pester test --- test/build.psm1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/build.psm1 b/test/build.psm1 index dced9c4..c349b12 100644 --- a/test/build.psm1 +++ b/test/build.psm1 @@ -1,8 +1,8 @@ #Basic variables initial $DownloadFolder = "https://github.com/PowerShell/PowerShell/releases/download/" -$ReleaseTag = "v6.0.0-alpha.14" -$Endfix = $ReleaseTag.Substring($ReleaseTag.LastIndexOf(".")+1,$ReleaseTag.Length - $ReleaseTag.LastIndexOf(".")-1) -$MSIversion = $ReleaseTag.Substring(1,$ReleaseTag.Length -1 ).Replace("-",".$Endfix-") +$ReleaseTag = "v6.0.0-alpha.16" +#$Endfix = $ReleaseTag.Substring($ReleaseTag.LastIndexOf(".")+1,$ReleaseTag.Length - $ReleaseTag.LastIndexOf(".")-1) +$MSIversion = $ReleaseTag.Substring(1,$ReleaseTag.Length -1 ).Replace("-","-") $version = $MSIversion.Substring(0,$MSIversion.IndexOf("-")) $ReleaseFolder = $DownloadFolder + $ReleaseTag $powershell = "C:\Program Files\PowerShell\$version\powershell.exe" @@ -33,12 +33,12 @@ function Start-PSRPInstall { } elseif($Runtime -eq "win81-x64" -or ($Runtime -eq "WS2012R2-x64")) { - $msiFile = "PowerShell_$MSIversion-win81-x64.msi" + $msiFile = "PowerShell_$MSIversion-win81-win2012r2-x64.msi" $msiURLFile = $ReleaseFolder+"/"+$msiFile } elseif($Runtime -eq "win10-x64" -or ($Runtime -eq "WS2016-x64")) { - $msiFile = "PowerShell_$MSIversion-win10-x64.msi" + $msiFile = "PowerShell_$MSIversion-win10-win2016-x64.msi" $msiURLFile = $ReleaseFolder+"/"+$msiFile } else @@ -65,7 +65,8 @@ function Start-PSRPInstall { "win7-x86", "win81-x64", "win10-x64", - "osx.10.11-x64")] + "WS2012R2-x64", + "WS2016-x64")] [Parameter(ParameterSetName='CoreCLR')] [string]$Runtime )