Test fixes for various platforms (#11579)

This commit is contained in:
Aditya Patwardhan
2020-01-14 10:57:13 -08:00
committed by Travis Plunk
parent aada0a80b7
commit d1ada89bb5
2 changed files with 16 additions and 4 deletions
@@ -127,8 +127,13 @@ Describe "Get-Timezone test cases" -Tags "CI" {
}
try {
$defaultParamValues = $PSDefaultParameterValues.Clone()
$PSDefaultParameterValues["it:skip"] = !$IsWindows
$defaultParamValues = $PSdefaultParameterValues.Clone()
# Set-TimeZone fails due to missing ApiSet dependency on Windows Server 2012 R2.
$osInfo = [System.Environment]::OSVersion.Version
$isSrv2k12R2 = $osInfo.Major -eq 6 -and $osInfo.Minor -eq 3
$PSDefaultParameterValues["it:skip"] = !$IsWindows -or $isSrv2k12R2
Describe "Set-Timezone test case: call by single Id" -Tags @('CI', 'RequireAdminOnWindows') {
BeforeAll {
@@ -230,4 +235,3 @@ try {
finally {
$global:PSDefaultParameterValues = $defaultParamValues
}
@@ -366,10 +366,18 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
<Capability Type="Shell"></Capability>
</Resource>
</Resources>
<Quotas MaxIdleTimeoutms="2147483646" MaxConcurrentUsers="2147483646" IdleTimeoutms="6200000" MaxProcessesPerShell="2147483646"
<Quotas MaxIdleTimeoutms="2147483646" MaxConcurrentUsers="{0}" IdleTimeoutms="6200000" MaxProcessesPerShell="2147483646"
MaxMemoryPerShellMB="2147483646" MaxConcurrentCommandsPerShell="2147483646" MaxShells="2147483646" MaxShellsPerUser="2147483646"></Quotas>
</PlugInConfiguration>
"@
$osInfo = [System.Environment]::OSVersion.Version
$isSrv2k12R2 = $osInfo.Major -eq 6 -and $osInfo.Minor -eq 3
# On Windows Server 2012R2 MaxConcurrentUsers is limited to 100.
$maxConcurrentUsers = if ($isSrv2k12R2) { '50' } else { '2147483646' }
$fileXml = $fileXml -f $maxConcurrentUsers
Set-Content -Path $testdrive\plugin.xml -Value $fileXml
try {
$plugin = New-Item -Path WSMan:\localhost\Plugin -File $testdrive\plugin.xml -Name TestPlugin2