Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit c645f7c

Browse files
author
Paulo Janotti
authored
Fix NamedPipe tests failing in Windows 7 and Nano (#27661)
Fixes failures related to test Connection_UnderDifferentUser_SingleSide_CurrentUserOnly_Fails
1 parent 4ecc7f7 commit c645f7c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CurrentUserOnly.netcoreapp.Windows.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ public void RunImpersonated(Action action)
124124
/// </summary>
125125
public class NamedPipeTest_CurrentUserOnly_Windows : NamedPipeTestBase, IClassFixture<TestAccountImpersonator>
126126
{
127+
public static bool IsAdminOnSupportedWindowsVersions => PlatformDetection.IsWindowsAndElevated
128+
&& !PlatformDetection.IsWindows7
129+
&& !PlatformDetection.IsWindowsNanoServer;
130+
127131
private TestAccountImpersonator _testAccountImpersonator;
128132

129133
public NamedPipeTest_CurrentUserOnly_Windows(TestAccountImpersonator testAccountImpersonator)
@@ -132,7 +136,7 @@ public NamedPipeTest_CurrentUserOnly_Windows(TestAccountImpersonator testAccount
132136
}
133137

134138
[OuterLoop]
135-
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsWindowsAndElevated))]
139+
[ConditionalTheory(nameof(IsAdminOnSupportedWindowsVersions))]
136140
[InlineData(PipeOptions.None, PipeOptions.CurrentUserOnly)]
137141
[InlineData(PipeOptions.CurrentUserOnly, PipeOptions.None)]
138142
public void Connection_UnderDifferentUser_SingleSide_CurrentUserOnly_Fails(PipeOptions serverPipeOptions, PipeOptions clientPipeOptions)

0 commit comments

Comments
 (0)