Skip one wmi test in Win Server Core (dotnet/corefx#24927)
authorPaulo Janotti <pauloja@microsoft.com>
Fri, 27 Oct 2017 21:27:06 +0000 (14:27 -0700)
committerDan Moseley <danmose@microsoft.com>
Fri, 27 Oct 2017 21:27:06 +0000 (14:27 -0700)
The test requires notepad.exe and that is not available on Win Server
Core. Fixes dotnet/corefx#24912.

Commit migrated from https://github.com/dotnet/corefx/commit/b94869b1c55b17361f3931da1274e4b58f2a18e6

src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs

index 1d28da4..d74aba2 100644 (file)
@@ -8,6 +8,9 @@ namespace System.Management.Tests
 {
     public class ManagementObjectTests
     {
+        // Need a specific condition for the test requiring notepad since not all windows versions that support WMI have it
+        public static bool IsWmiSupportedAndHasNotepad => WmiTestHelper.IsWmiSupported && PlatformDetection.IsNotWindowsServerCore;
+
         [ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
         public void Get_Win32_LogicalDisk()
         {
@@ -48,7 +51,7 @@ namespace System.Management.Tests
             }
         }
 
-        [ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
+        [ConditionalFact(nameof(IsWmiSupportedAndHasNotepad))]
         [OuterLoop]
         public void Invoke_Instance_And_Static_Method_Win32_Process()
         {