From cf77813c82a2c03e5006071dffd55b15457aef73 Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Tue, 3 Jan 2017 14:23:49 -0800 Subject: [PATCH] Re-enable HTTPS tests (#1273). --- samples/SampleApp/project.json | 2 +- .../AddressRegistrationTests.cs | 4 ++-- .../HttpClientSlimTests.cs | 4 ++-- .../HttpsTests.cs | 5 ++--- .../LoggingConnectionAdapterTests.cs | 2 +- .../MaxRequestBufferSizeTests.cs | 2 +- .../HttpsConnectionAdapterTests.cs | 14 +++++++------- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/samples/SampleApp/project.json b/samples/SampleApp/project.json index 557ab3faa6..c7f940c21b 100644 --- a/samples/SampleApp/project.json +++ b/samples/SampleApp/project.json @@ -28,5 +28,5 @@ "configProperties": { "System.GC.Server": true } - } + } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs index 2b57c4d575..58044e3692 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs @@ -36,14 +36,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests await RegisterAddresses_Success(addressInput, testUrls); } - [Theory(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)"), MemberData(nameof(IPEndPointRegistrationDataRandomPort))] + [ConditionalTheory, MemberData(nameof(IPEndPointRegistrationDataRandomPort))] [IPv6SupportedCondition] public async Task RegisterIPEndPoint_RandomPort_Success(IPEndPoint endPoint, Func testUrl) { await RegisterIPEndPoint_Success(endPoint, testUrl); } - [ConditionalTheory(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)"), MemberData(nameof(IPEndPointRegistrationDataPort443))] + [ConditionalTheory, MemberData(nameof(IPEndPointRegistrationDataPort443))] [IPv6SupportedCondition] [PortSupportedCondition(443)] public async Task RegisterIPEndPoint_Port443_Success(IPEndPoint endpoint, Func testUrl) diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpClientSlimTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpClientSlimTests.cs index 76cd68c918..28c1b95773 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpClientSlimTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpClientSlimTests.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task GetStringAsyncHttps() { using (var host = StartHost(protocol: "https")) @@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task PostAsyncHttps() { using (var host = StartHost(protocol: "https", diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpsTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpsTests.cs index 85ed2e6fd6..c5c594f574 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpsTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/HttpsTests.cs @@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } // Regression test for https://github.com/aspnet/KestrelHttpServer/issues/1103#issuecomment-246971172 - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task DoesNotThrowObjectDisposedExceptionOnConnectionAbort() { var x509Certificate2 = new X509Certificate2("TestResources/testCert.pfx", "testPassword"); @@ -104,7 +104,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests listenOptions.UseHttps("TestResources/testCert.pfx", "testPassword"); }); }) - .UseUrls("https://127.0.0.1:0/") .UseLoggerFactory(loggerFactory) .Configure(app => app.Run(async httpContext => { @@ -144,7 +143,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests Assert.False(loggerFactory.ErrorLogger.ObjectDisposedExceptionLogged); } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task DoesNotThrowObjectDisposedExceptionFromWriteAsyncAfterConnectionIsAborted() { var tcs = new TaskCompletionSource(); diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/LoggingConnectionAdapterTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/LoggingConnectionAdapterTests.cs index 6637baea9c..adff41264c 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/LoggingConnectionAdapterTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/LoggingConnectionAdapterTests.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests { public class LoggingConnectionAdapterTests { - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task LoggingConnectionFilterCanBeAddedBeforeAndAfterHttpsFilter() { var host = new WebHostBuilder() diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestBufferSizeTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestBufferSizeTests.cs index 3449b08b51..a7116d6b07 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestBufferSizeTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestBufferSizeTests.cs @@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } - [Theory(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Theory] [MemberData("LargeUploadData")] public async Task LargeUpload(long? maxRequestBufferSize, bool ssl, bool expectPause) { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs index d37027adc6..0fb3642b0e 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs @@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // https://github.com/aspnet/KestrelHttpServer/issues/240 // This test currently fails on mono because of an issue with SslStream. - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task CanReadAndWriteWithHttpsConnectionAdapter() { var serviceContext = new TestServiceContext(); @@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task RequireCertificateFailsWhenNoCertificate() { var serviceContext = new TestServiceContext(); @@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task AllowCertificateContinuesWhenNoCertificate() { var serviceContext = new TestServiceContext(); @@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task CertificatePassedToHttpContext() { var serviceContext = new TestServiceContext(); @@ -178,7 +178,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task HttpsSchemePassedToRequestFeature() { var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) @@ -197,7 +197,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task DoesNotSupportTls10() { var serviceContext = new TestServiceContext(); @@ -325,7 +325,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } } - [Fact(Skip = "SslStream hanging on write after update to CoreFx 4.4 (https://github.com/dotnet/corefx/issues/14698)")] + [Fact] public async Task CertificatePassedToHttpContextIsNotDisposed() { var serviceContext = new TestServiceContext();