Use dynamic ports for Https/Ntlm tests (#874)

This commit is contained in:
Hao Kung 2018-06-21 14:27:48 -07:00 committed by GitHub
parent e5505ceefc
commit de197bfcd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -6,6 +6,7 @@ using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using IISIntegration.FunctionalTests.Utilities;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Server.IntegrationTesting.Common;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
using Xunit.Abstractions;
@ -30,10 +31,11 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
[MemberData(nameof(TestVariants))]
public async Task HttpsHelloWorld(TestVariant variant)
{
var port = TestPortHelper.GetNextSSLPort();
var deploymentParameters = new DeploymentParameters(variant)
{
ApplicationPath = Helpers.GetOutOfProcessTestSitesPath(),
ApplicationBaseUriHint = "https://localhost:44394/",
ApplicationBaseUriHint = $"https://localhost:{port}/",
ServerConfigTemplateContent = GetHttpsServerConfig()
};
@ -53,7 +55,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
[MemberData(nameof(TestVariants))]
public Task HttpsHelloWorld_NoClientCert(TestVariant variant)
{
return HttpsHelloWorldCerts(variant, port: 44397, sendClientCert: false);
return HttpsHelloWorldCerts(variant, sendClientCert: false);
}
#pragma warning disable xUnit1004 // Test methods should not be skipped
@ -62,11 +64,12 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
#pragma warning restore xUnit1004 // Test methods should not be skipped
public Task HttpsHelloWorld_ClientCert(TestVariant variant)
{
return HttpsHelloWorldCerts(variant, port: 44301, sendClientCert: true);
return HttpsHelloWorldCerts(variant, sendClientCert: true);
}
private async Task HttpsHelloWorldCerts(TestVariant variant, int port, bool sendClientCert)
private async Task HttpsHelloWorldCerts(TestVariant variant, bool sendClientCert)
{
var port = TestPortHelper.GetNextSSLPort();
var deploymentParameters = new DeploymentParameters(variant)
{
ApplicationPath = Helpers.GetOutOfProcessTestSitesPath(),

View File

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
@ -31,7 +30,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
var deploymentParameters = new DeploymentParameters(variant)
{
ApplicationPath = Helpers.GetOutOfProcessTestSitesPath(),
ApplicationBaseUriHint = "http://localhost:5052"
ApplicationBaseUriHint = $"http://localhost:0/",
};
var result = await DeployAsync(deploymentParameters);