From 4a40c59723582c7cd49db4ceea3c5449257857f5 Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Fri, 15 Sep 2017 22:19:40 -0700 Subject: [PATCH 1/4] Disable NegotiateStreamTest fixture entirely because setup-kdc.sh is broken on some distros --- .../tests/FunctionalTests/NegotiateStreamTestForUnix.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs index 531e79123309..6d5dd39c1f93 100644 --- a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs +++ b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs @@ -115,6 +115,7 @@ private static int RunSetupScript(string args = null) } [PlatformSpecific(TestPlatforms.Linux)] + [ActiveIssue(24000)] [Trait(XunitConstants.Category, XunitConstants.RequiresElevation)] public class NegotiateStreamTest : IDisposable, IClassFixture { From d4d507addaab8b51115e01792406ea7abe891d47 Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Sat, 16 Sep 2017 13:06:35 -0700 Subject: [PATCH 2/4] Limit to currently failing distros --- .../src/System/PlatformDetection.Unix.cs | 3 ++ .../src/System/PlatformDetection.Windows.cs | 3 ++ .../NegotiateStreamTestForUnix.cs | 33 ++++++++++++++----- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Unix.cs b/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Unix.cs index b606cb5ee982..abb86f939948 100644 --- a/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Unix.cs +++ b/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Unix.cs @@ -33,6 +33,9 @@ public static partial class PlatformDetection public static bool IsDebian => IsDistroAndVersion("debian"); public static bool IsDebian8 => IsDistroAndVersion("debian", "8"); public static bool IsUbuntu1404 => IsDistroAndVersion("ubuntu", "14.04"); + public static bool IsUbuntu1604 => IsDistroAndVersion("ubuntu", "16.04"); + public static bool IsUbuntu1704 => IsDistroAndVersion("ubuntu", "17.04"); + public static bool IsUbuntu1710 => IsDistroAndVersion("ubuntu", "17.10"); public static bool IsCentos7 => IsDistroAndVersion("centos", "7"); public static bool IsTizen => IsDistroAndVersion("tizen"); public static bool IsNotFedoraOrRedHatOrCentos => !IsDistroAndVersion("fedora") && !IsDistroAndVersion("rhel") && !IsDistroAndVersion("centos"); diff --git a/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Windows.cs b/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Windows.cs index 9d93f3c45e5a..ce31c9965a0a 100644 --- a/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Windows.cs +++ b/src/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Windows.cs @@ -21,6 +21,9 @@ public static partial class PlatformDetection public static bool IsDebian => false; public static bool IsDebian8 => false; public static bool IsUbuntu1404 => false; + public static bool IsUbuntu1604 => false; + public static bool IsUbuntu1704 => false; + public static bool IsUbuntu1710 => false; public static bool IsCentos7 => false; public static bool IsTizen => false; public static bool IsNotFedoraOrRedHatOrCentos => true; diff --git a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs index 6d5dd39c1f93..bb5b4a114cb8 100644 --- a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs +++ b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs @@ -72,15 +72,31 @@ public bool CheckAndClearCredentials(ITestOutputHelper output) } // Clear the credentials - var startInfo = new ProcessStartInfo(KDestroyCmd); - startInfo.UseShellExecute = true; - startInfo.CreateNoWindow = true; - startInfo.Arguments = "-A"; - using (Process clearCreds = Process.Start(startInfo)) + try { - clearCreds.WaitForExit(); - output.WriteLine("kdestroy returned {0}", clearCreds.ExitCode); - return (clearCreds.ExitCode == 0); + var startInfo = new ProcessStartInfo(KDestroyCmd); + startInfo.UseShellExecute = true; + startInfo.CreateNoWindow = true; + startInfo.Arguments = "-A"; + using (Process clearCreds = Process.Start(startInfo)) + { + clearCreds.WaitForExit(); + output.WriteLine("kdestroy returned {0}", clearCreds.ExitCode); + return (clearCreds.ExitCode == 0); + } + } + catch (Win32Exception) + { + // https://github.com/dotnet/corefx/issues/24000 + // on these distros right now + Assert.True(PlatformDetection.IsUbuntu1704 || + PlatformDetection.IsUbuntu1710 || + PlatformDetection.IsOpenSUSE || + PlatformDetection.IsFedora || + PlatformDetection.IsDebian || + PlatformDetection.IsCentos7); + + return false; } } @@ -115,7 +131,6 @@ private static int RunSetupScript(string args = null) } [PlatformSpecific(TestPlatforms.Linux)] - [ActiveIssue(24000)] [Trait(XunitConstants.Category, XunitConstants.RequiresElevation)] public class NegotiateStreamTest : IDisposable, IClassFixture { From 1c1a452eb3031ae5a5db9196e8a1794f290ec2ec Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Sat, 16 Sep 2017 14:53:38 -0700 Subject: [PATCH 3/4] oversight --- .../ref/CoreFx.Private.TestUtilities.cs | 3 +++ .../tests/FunctionalTests/NegotiateStreamTestForUnix.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/CoreFx.Private.TestUtilities/ref/CoreFx.Private.TestUtilities.cs b/src/CoreFx.Private.TestUtilities/ref/CoreFx.Private.TestUtilities.cs index 97be5d7274c5..e9b82e16bbe7 100644 --- a/src/CoreFx.Private.TestUtilities/ref/CoreFx.Private.TestUtilities.cs +++ b/src/CoreFx.Private.TestUtilities/ref/CoreFx.Private.TestUtilities.cs @@ -77,6 +77,9 @@ public static partial class PlatformDetection public static Version ICUVersion { get { return null; } } public static bool IsUbuntu { get { throw null; } } public static bool IsUbuntu1404 { get { throw null; } } + public static bool IsUbuntu1604 { get { throw null; } } + public static bool IsUbuntu1704 { get { throw null; } } + public static bool IsUbuntu1710 { get { throw null; } } public static bool IsWindows { get { throw null; } } public static bool IsWindows10InsiderPreviewBuild16215OrGreater { get { throw null; } } public static bool IsWindows10Version1607OrGreater { get { throw null; } } diff --git a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs index bb5b4a114cb8..d6b6a0fccbe5 100644 --- a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs +++ b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs @@ -7,6 +7,7 @@ using System.IO; using System.Linq; using System.Net.Test.Common; +using System.Runtime.InteropServices; using System.Security.Authentication; using System.Security.Principal; using System.Text; From bb77128c10d80888512031e9a95feb41a99c1ef8 Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Sat, 16 Sep 2017 15:37:42 -0700 Subject: [PATCH 4/4] Wrong import --- .../tests/FunctionalTests/NegotiateStreamTestForUnix.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs index d6b6a0fccbe5..8522a20c56aa 100644 --- a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs +++ b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs @@ -3,11 +3,11 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Test.Common; -using System.Runtime.InteropServices; using System.Security.Authentication; using System.Security.Principal; using System.Text;