mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Move Windows features to toolset (#3838)
* move windows features to toolset * Update WindowsFeatures.Tests.ps1 * revert templates
This commit is contained in:
@@ -1,33 +1,17 @@
|
||||
Describe "WindowsFeatures" {
|
||||
$windowsFeatures = (Get-ToolsetContent).windowsFeatures
|
||||
$testCases = $windowsFeatures | ForEach-Object { @{ Name = $_.name; OptionalFeature = $_.optionalFeature } }
|
||||
|
||||
$testCases = @(
|
||||
@{ FeatureName = "NET-Framework-Features" }
|
||||
@{ FeatureName = "NET-Framework-45-Features" }
|
||||
@{ FeatureName = "FS-iSCSITarget-Server" }
|
||||
)
|
||||
|
||||
if (Test-isWin16) {
|
||||
$testCases += @{ FeatureName = "BITS" }
|
||||
$testCases += @{ FeatureName = "DSC-Service" }
|
||||
}
|
||||
if (Test-isWin19) {
|
||||
$testCases += @{ FeatureName = "Microsoft-Windows-Subsystem-Linux" }
|
||||
}
|
||||
|
||||
It "Windows Feature <FeatureName> is installed" -TestCases $testCases {
|
||||
(Get-WindowsFeature -Name $FeatureName).InstallState | Should -Be "Installed"
|
||||
}
|
||||
|
||||
if (Test-isWin19) {
|
||||
it "Check WSL is on path" {
|
||||
(Get-Command -Name 'wsl') | Should -BeTrue
|
||||
It "Windows Feature <Name> is installed" -TestCases $testCases {
|
||||
if ($OptionalFeature) {
|
||||
(Get-WindowsOptionalFeature -Online -FeatureName $Name).State | Should -Be "Enabled"
|
||||
} else {
|
||||
(Get-WindowsFeature -Name $Name).InstallState | Should -Be "Installed"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Describe "ContainersFeature" {
|
||||
It "Windows containers feature is installed" {
|
||||
(Get-WindowsFeature -Name "Containers").InstallState | Should -Be "Installed"
|
||||
it "Check WSL is on path" -Skip:(-not (Test-IsWin19)) {
|
||||
(Get-Command -Name 'wsl') | Should -BeTrue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user