From a426032cda259c7663868d362081100f669a686e Mon Sep 17 00:00:00 2001 From: Mitchell Hwang <16830051+mdh1418@users.noreply.github.com> Date: Thu, 5 Aug 2021 07:33:47 -0400 Subject: [PATCH] [libraries][Android] Reenable System.Diagnostics.Debug, System.Net.Http.Json, System.Net.Ping, System.Security.Cryptography.X509Certificates (#56852) Co-authored-by: Mitchell Hwang --- .../tests/DebugTestsNoListeners.cs | 2 -- .../tests/DebugTestsUsingListeners.cs | 1 - .../tests/FunctionalTests/JsonContentTests.cs | 1 - .../System.Net.Ping/tests/FunctionalTests/PingTest.cs | 12 +----------- .../tests/FunctionalTests/UnixPingUtilityTests.cs | 15 +++++++-------- .../System.Private.Uri/tests/FunctionalTests/UriTests.cs | 1 - .../Runtime/InteropServices/Marshal/OffsetOfTests.cs | 2 -- .../CertificateCreation/CertificateRequestUsageTests.cs | 2 -- .../tests/PfxFormatTests.cs | 7 +------ .../tests/X500DistinguishedNameEncodingTests.cs | 1 - .../tests/X509Certificate2PemTests.cs | 2 -- 11 files changed, 9 insertions(+), 37 deletions(-) diff --git a/src/libraries/System.Diagnostics.Debug/tests/DebugTestsNoListeners.cs b/src/libraries/System.Diagnostics.Debug/tests/DebugTestsNoListeners.cs index 4277946..bb3be77 100644 --- a/src/libraries/System.Diagnostics.Debug/tests/DebugTestsNoListeners.cs +++ b/src/libraries/System.Diagnostics.Debug/tests/DebugTestsNoListeners.cs @@ -67,7 +67,6 @@ namespace System.Diagnostics.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50570", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/36882", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void Debug_WriteLineNull_IndentsEmptyStringProperly() { @@ -210,7 +209,6 @@ namespace System.Diagnostics.Tests [InlineData(-1, 0)] [InlineData(0, 0)] [InlineData(1, 1)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50570", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/36882", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void IndentLevel_Set_GetReturnsExpected(int indentLevel, int expectedIndentLevel) { diff --git a/src/libraries/System.Diagnostics.Debug/tests/DebugTestsUsingListeners.cs b/src/libraries/System.Diagnostics.Debug/tests/DebugTestsUsingListeners.cs index 52b428e..77ada82 100644 --- a/src/libraries/System.Diagnostics.Debug/tests/DebugTestsUsingListeners.cs +++ b/src/libraries/System.Diagnostics.Debug/tests/DebugTestsUsingListeners.cs @@ -231,7 +231,6 @@ namespace System.Diagnostics.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50570", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/36882", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void TraceWriteLineIf() { diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs index 3fac43d..a23a7c8 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs @@ -143,7 +143,6 @@ namespace System.Net.Http.Json.Functional.Tests => AssertExtensions.Throws("inputType", () => JsonContent.Create(null, inputType: null, mediaType: null)); [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52650", TestPlatforms.Android)] public void JsonContentThrowsOnIncompatibleTypeAsync() { using (HttpClient client = new HttpClient()) diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs index 22e2ccb..b206e1e 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs @@ -124,7 +124,6 @@ namespace System.Net.NetworkInformation.Tests [Theory] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddress(AddressFamily addressFamily) { @@ -167,7 +166,6 @@ namespace System.Net.NetworkInformation.Tests [Theory] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddress_AddressAsString(AddressFamily addressFamily) { @@ -201,7 +199,6 @@ namespace System.Net.NetworkInformation.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddressAndTimeout() { @@ -263,7 +260,6 @@ namespace System.Net.NetworkInformation.Tests [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddressAndTimeoutAndBuffer_Unix() { @@ -354,7 +350,6 @@ namespace System.Net.NetworkInformation.Tests [Theory] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix(AddressFamily addressFamily) { @@ -418,7 +413,6 @@ namespace System.Net.NetworkInformation.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHost() { @@ -447,7 +441,6 @@ namespace System.Net.NetworkInformation.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHostAndTimeout() { @@ -509,7 +502,6 @@ namespace System.Net.NetworkInformation.Tests [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHostAndTimeoutAndBuffer_Unix() { @@ -596,7 +588,6 @@ namespace System.Net.NetworkInformation.Tests [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHostAndTimeoutAndBufferAndPingOptions_Unix() { @@ -656,7 +647,7 @@ namespace System.Net.NetworkInformation.Tests { // Assert.DoesNotThrow PingReply pingReply = await p.SendPingAsync(localIpAddress, TestSettings.PingTimeout, new byte[10001]); - + // Depending on platform the call may either succeed, report timeout or report too big packet. It // should not throw wrapped SocketException though which is what this test guards. // @@ -688,7 +679,6 @@ namespace System.Net.NetworkInformation.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task Sends_ReuseInstance_Hostname() { diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs index 78478cf..0d686f9 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs @@ -33,7 +33,7 @@ namespace System.Net.NetworkInformation.Tests p.StartInfo.RedirectStandardOutput = true; Stopwatch stopWatch = Stopwatch.StartNew(); - + p.Start(); p.WaitForExit(); @@ -47,7 +47,6 @@ namespace System.Net.NetworkInformation.Tests [InlineData(50)] [InlineData(1000)] [PlatformSpecific(TestPlatforms.AnyUnix)] // Tests un-priviledged Ping support on Unix - [ActiveIssue("https://github.com/dotnet/runtime/issues/50574", TestPlatforms.Android)] public static async Task PacketSizeIsRespected(int payloadSize) { var stdOutLines = new List(); @@ -55,15 +54,15 @@ namespace System.Net.NetworkInformation.Tests Process p = ConstructPingProcess(await TestSettings.GetLocalIPAddressAsync(), payloadSize, 1000); p.StartInfo.RedirectStandardOutput = true; - p.OutputDataReceived += delegate (object sendingProcess, DataReceivedEventArgs outputLine) - { - stdOutLines.Add(outputLine.Data); + p.OutputDataReceived += delegate (object sendingProcess, DataReceivedEventArgs outputLine) + { + stdOutLines.Add(outputLine.Data); }; p.StartInfo.RedirectStandardError = true; - p.ErrorDataReceived += delegate (object sendingProcess, DataReceivedEventArgs errorLine) - { - stdErrLines.Add(errorLine.Data); + p.ErrorDataReceived += delegate (object sendingProcess, DataReceivedEventArgs errorLine) + { + stdErrLines.Add(errorLine.Data); }; p.Start(); diff --git a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs index 24be0ef..2b2222f 100644 --- a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs +++ b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs @@ -750,7 +750,6 @@ namespace System.PrivateUri.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/49932", TestPlatforms.Android)] public static void Uri_DoesNotLockOnString() { // Don't intern the string we lock on diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs index d4257da..00fc49e 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs @@ -33,7 +33,6 @@ namespace System.Runtime.InteropServices.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/49872", TestPlatforms.Android)] public void OffsetOf_ExplicitLayout_ReturnsExpected() { Type t = typeof(ExplicitLayoutTest); @@ -106,7 +105,6 @@ namespace System.Runtime.InteropServices.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/49872", TestPlatforms.Android)] public void OffsetOf_Decimal_ReturnsExpected() { Type t = typeof(FieldAlignmentTest_Decimal); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs index a9c3f64..d753f8e 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs @@ -493,7 +493,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests.CertificateCreatio [InlineData("Empty", "")] [InlineData("Reserved Tag", "0F00")] [InlineData("Zero Tag", "0000")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public static void InvalidPublicKeyEncoding(string caseName, string parametersHex) { _ = caseName; @@ -526,7 +525,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests.CertificateCreatio [InlineData("Non-Nested Data", "300206035102013001")] [InlineData("Indefinite Encoding", "3002060351020130800000")] [InlineData("Dangling LengthLength", "300206035102013081")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public static void InvalidSignatureAlgorithmEncoding(string caseName, string sigAlgHex) { _ = caseName; diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.cs index 240c020..3b83ac2 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.cs @@ -107,7 +107,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests int altWin32Error = 0); [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_NoMac() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -116,7 +115,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_NoMac_ArbitraryPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -128,7 +126,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_EmptyPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -140,7 +137,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_NullPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -152,7 +148,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_BadPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -871,7 +866,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests cert, new[] { cert, cert }, CheckMultiBoundKeyConsistency); - } + } } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs index f57f973..868e75e 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs @@ -106,7 +106,6 @@ namespace System.Security.Cryptography.X509Certificates.Tests [InlineData("CN=\"unterminated", InvalidX500NameFragment)] // Non-ASCII values in an E field [InlineData("E=\u65E5\u672C\u8A9E", InvalidIA5StringFragment)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public static void InvalidInput(string input, string messageFragment) { CryptographicException exception = diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509Certificate2PemTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509Certificate2PemTests.cs index e8ce8c9..c53367a 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509Certificate2PemTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509Certificate2PemTests.cs @@ -29,7 +29,6 @@ MII } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public static void CreateFromPem_CryptographicException_InvalidKeyAlgorithm() { CryptographicException ce = Assert.Throws(() => @@ -206,7 +205,6 @@ MII } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public static void CreateFromEncryptedPem_Rsa_InvalidPassword_Fail() { CryptographicException ce = Assert.Throws(() => -- 2.7.4