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 - .../tests/FunctionalTests/PingTest.cs | 12 +----------- .../tests/FunctionalTests/UnixPingUtilityTests.cs | 15 +++++++-------- .../tests/FunctionalTests/UriTests.cs | 1 - .../InteropServices/Marshal/OffsetOfTests.cs | 2 -- .../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 4277946a7a29b..bb3be7721693d 100644 --- a/src/libraries/System.Diagnostics.Debug/tests/DebugTestsNoListeners.cs +++ b/src/libraries/System.Diagnostics.Debug/tests/DebugTestsNoListeners.cs @@ -67,7 +67,6 @@ public void Debug_WriteNull_SkipsIndentation() } [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 @@ public void IndentSize_Set_GetReturnsExpected(int indentSize, int expectedIndent [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 52b428efce742..77ada82c74a08 100644 --- a/src/libraries/System.Diagnostics.Debug/tests/DebugTestsUsingListeners.cs +++ b/src/libraries/System.Diagnostics.Debug/tests/DebugTestsUsingListeners.cs @@ -231,7 +231,6 @@ public void TraceWriteIf() } [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 3fac43d3511c1..a23a7c803fbdd 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 @@ public void JsonContentInputTypeIsNull() => 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 22e2ccb3d28e9..b206e1e0f165d 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 @@ public async Task SendPingAsync_InvalidArgs() [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 @@ await SendBatchPingAsync( [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 @@ await SendBatchPingAsync( } [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 @@ await SendBatchPingAsync( [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 @@ await SendBatchPingAsync( [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 @@ await SendBatchPingAsync( } [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 @@ await SendBatchPingAsync( } [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 @@ await SendBatchPingAsync( [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 @@ await SendBatchPingAsync( [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 @@ public async Task SendPingWithIPAddressAndBigSize() { // 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 @@ public async Task SendPings_ReuseInstance_Hostname() } [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 78478cf7bbd6a..0d686f9a8ee4a 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 @@ public static void TimeoutIsRespected(int timeout) p.StartInfo.RedirectStandardOutput = true; Stopwatch stopWatch = Stopwatch.StartNew(); - + p.Start(); p.WaitForExit(); @@ -47,7 +47,6 @@ public static void TimeoutIsRespected(int timeout) [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 @@ public static async Task PacketSizeIsRespected(int payloadSize) 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 24be0ef822743..2b2222f315d82 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 @@ public static void Uri_CachesDnsSafeHost() } [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 d4257da655aa1..00fc49e78c552 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 @@ public void OffsetOf_ClassWithSequentialLayout_ReturnsExpected() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/49872", TestPlatforms.Android)] public void OffsetOf_ExplicitLayout_ReturnsExpected() { Type t = typeof(ExplicitLayoutTest); @@ -106,7 +105,6 @@ public void OffsetOf_ValidField_ReturnsExpected() } [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 a9c3f642e3947..d753f8e477da7 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 @@ public static void CheckTimeNested() [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 @@ public static void InvalidPublicKeyEncoding(string caseName, string parametersHe [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 240c0209d21e5..3b83ac201e509 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 @@ protected abstract void ReadUnreadablePfx( 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 @@ public void EmptyPfx_NoMac() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_NoMac_ArbitraryPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -128,7 +126,6 @@ public void EmptyPfx_NoMac_ArbitraryPassword() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_EmptyPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -140,7 +137,6 @@ public void EmptyPfx_EmptyPassword() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_NullPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -152,7 +148,6 @@ public void EmptyPfx_NullPassword() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public void EmptyPfx_BadPassword() { Pkcs12Builder builder = new Pkcs12Builder(); @@ -871,7 +866,7 @@ public void CertAndKeyTwice_KeysUntagged() 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 f57f9739589bd..868e75ea994dc 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 @@ public static void VerifySeparatorProcessing(X500DistinguishedNameFlags flags) [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 e8ce8c9869f10..c53367a5b0d44 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 @@ public static void CreateFromPem_CryptographicException_MalformedCertificate() } [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 @@ public static void CreateFromEncryptedPem_Rsa_KeyMismatch_Fail() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50937", TestPlatforms.Android)] public static void CreateFromEncryptedPem_Rsa_InvalidPassword_Fail() { CryptographicException ce = Assert.Throws(() =>