@@ -159,6 +159,7 @@ Describe "Linux Containers" -Tags 'Behavior', 'Linux' {
159
159
$runTestCases += @ {
160
160
Name = $_.Name
161
161
ExpectedVersion = $_.ExpectedVersion
162
+ Channel = $_.Channel
162
163
}
163
164
}
164
165
@@ -186,6 +187,7 @@ Describe "Linux Containers" -Tags 'Behavior', 'Linux' {
186
187
}
187
188
188
189
Context " Run Powershell" {
190
+
189
191
it " Get PSVersion table from <Name> should be <ExpectedVersion>" - TestCases $runTestCases - Skip:$script :skipLinuxRun {
190
192
param (
191
193
[Parameter (Mandatory = $true )]
@@ -194,7 +196,11 @@ Describe "Linux Containers" -Tags 'Behavior', 'Linux' {
194
196
195
197
[Parameter (Mandatory = $true )]
196
198
[string ]
197
- $ExpectedVersion
199
+ $ExpectedVersion ,
200
+
201
+ [Parameter (Mandatory = $true )]
202
+ [string ]
203
+ $Channel
198
204
)
199
205
200
206
$actualVersion = Get-ContainerPowerShellVersion - TestContext $testContext - Name $Name
@@ -222,7 +228,11 @@ Describe "Linux Containers" -Tags 'Behavior', 'Linux' {
222
228
223
229
[Parameter (Mandatory = $true )]
224
230
[string ]
225
- $ExpectedVersion
231
+ $ExpectedVersion ,
232
+
233
+ [Parameter (Mandatory = $true )]
234
+ [string ]
235
+ $Channel
226
236
)
227
237
228
238
$culture = Get-UICultureUsingContainer - Name $Name
@@ -249,9 +259,17 @@ Describe "Linux Containers" -Tags 'Behavior', 'Linux' {
249
259
250
260
[Parameter (Mandatory = $true )]
251
261
[string ]
252
- $ExpectedVersion
262
+ $ExpectedVersion ,
263
+
264
+ [Parameter (Mandatory = $true )]
265
+ [string ]
266
+ $Channel
253
267
)
254
268
269
+ if ($Channel -ne ' preview' ) {
270
+ Set-ItResult - Skipped - Because " Test is not applicable to $Channel "
271
+ }
272
+
255
273
$psDistChannel = Get-PowerShellDistibutionChannel - TestContext $testContext - Name $Name
256
274
$psDistChannel | Should - BeLike " PSDocker-*"
257
275
}
@@ -550,6 +568,7 @@ Describe "Windows Containers" -Tags 'Behavior', 'Windows' {
550
568
$runTestCases += @ {
551
569
Name = $_.Name
552
570
ExpectedVersion = $_.ExpectedVersion
571
+ Channel = $_.Channel
553
572
}
554
573
}
555
574
@@ -574,7 +593,11 @@ Describe "Windows Containers" -Tags 'Behavior', 'Windows' {
574
593
575
594
[Parameter (Mandatory = $true )]
576
595
[string ]
577
- $ExpectedVersion
596
+ $ExpectedVersion ,
597
+
598
+ [Parameter (Mandatory = $true )]
599
+ [string ]
600
+ $Channel
578
601
)
579
602
580
603
Get-ContainerPowerShellVersion - TestContext $testContext - Name $Name | should - be $ExpectedVersion
@@ -607,15 +630,19 @@ Describe "Windows Containers" -Tags 'Behavior', 'Windows' {
607
630
$path | should -Match ([System.Text.RegularExpressions.Regex ]::Escape(" C:\Windows\system32" ))
608
631
}
609
632
610
- it " Has POWERSHELL_DISTRIBUTION_CHANNEL environment variable defined" - TestCases $runTestCases - Skip:$script :skipLinuxRun {
633
+ it " Has POWERSHELL_DISTRIBUTION_CHANNEL environment variable defined" - TestCases $runTestCases - Skip:$script :skipWindowsRun {
611
634
param (
612
635
[Parameter (Mandatory = $true )]
613
636
[string ]
614
637
$name ,
615
638
616
639
[Parameter (Mandatory = $true )]
617
640
[string ]
618
- $ExpectedVersion
641
+ $ExpectedVersion ,
642
+
643
+ [Parameter (Mandatory = $true )]
644
+ [string ]
645
+ $Channel
619
646
)
620
647
621
648
$psDistChannel = Get-PowerShellDistibutionChannel - TestContext $testContext - Name $Name
0 commit comments