Updating Xunit and dotnet versions (#143)
This commit is contained in:
parent
2e540341db
commit
f130330db8
|
|
@ -2,7 +2,8 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AspNetCoreVersion>1.2.0-*</AspNetCoreVersion>
|
<AspNetCoreVersion>1.2.0-*</AspNetCoreVersion>
|
||||||
<InternalAspNetCoreSdkVersion>2.1.1-*</InternalAspNetCoreSdkVersion>
|
<InternalAspNetCoreSdkVersion>2.1.1-*</InternalAspNetCoreSdkVersion>
|
||||||
<TestSdkVersion>15.3.0-*</TestSdkVersion>
|
<TestSdkVersion>15.3.0</TestSdkVersion>
|
||||||
<XunitVersion>2.3.0-beta2-*</XunitVersion>
|
<XunitAnalyzersVersion>0.6.1</XunitAnalyzersVersion>
|
||||||
|
<XunitVersion>2.3.0-beta4-build3742</XunitVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1063,17 +1063,22 @@ Finished:
|
||||||
if (strEventMsg.IsEmpty())
|
if (strEventMsg.IsEmpty())
|
||||||
{
|
{
|
||||||
if (!fDonePrepareCommandLine)
|
if (!fDonePrepareCommandLine)
|
||||||
|
{
|
||||||
|
|
||||||
strEventMsg.SafeSnwprintf(
|
strEventMsg.SafeSnwprintf(
|
||||||
m_struAppFullPath.QueryStr(),
|
m_struAppFullPath.QueryStr(),
|
||||||
ASPNETCORE_EVENT_PROCESS_START_INTERNAL_ERROR_MSG,
|
ASPNETCORE_EVENT_PROCESS_START_INTERNAL_ERROR_MSG,
|
||||||
hr);
|
hr);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
strEventMsg.SafeSnwprintf(
|
strEventMsg.SafeSnwprintf(
|
||||||
ASPNETCORE_EVENT_PROCESS_START_POSTCREATE_ERROR_MSG,
|
ASPNETCORE_EVENT_PROCESS_START_POSTCREATE_ERROR_MSG,
|
||||||
m_struAppFullPath.QueryStr(),
|
m_struAppFullPath.QueryStr(),
|
||||||
m_pszRootApplicationPath.QueryStr(),
|
m_pszRootApplicationPath.QueryStr(),
|
||||||
struCommandLine.QueryStr(),
|
struCommandLine.QueryStr(),
|
||||||
hr);
|
hr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apsz[0] = strEventMsg.QueryStr();
|
apsz[0] = strEventMsg.QueryStr();
|
||||||
|
|
|
||||||
|
|
@ -196,9 +196,9 @@ namespace AspNetCoreModule.Test.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Currently we use DotnetCore v1.0
|
// Currently we use DotnetCore v2.0
|
||||||
//
|
//
|
||||||
string publishPath = Path.Combine(srcPath, "bin", "Debug", "netcoreapp1.0", "publish");
|
string publishPath = Path.Combine(srcPath, "bin", "Debug", "netcoreapp2.0", "publish");
|
||||||
string publishPathOutput = Path.Combine(Environment.ExpandEnvironmentVariables("%SystemDrive%") + @"\", "inetpub", "ANCMTest", "publishPathOutput");
|
string publishPathOutput = Path.Combine(Environment.ExpandEnvironmentVariables("%SystemDrive%") + @"\", "inetpub", "ANCMTest", "publishPathOutput");
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
await DoBasicTest(appPoolBitness);
|
await DoBasicTest(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -34,7 +34,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoRapidFailsPerMinuteTest(appPoolBitness, valueOfRapidFailsPerMinute);
|
return DoRapidFailsPerMinuteTest(appPoolBitness, valueOfRapidFailsPerMinute);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -55,7 +55,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoShutdownTimeLimitTest(appPoolBitness, valueOfshutdownTimeLimit, expectedClosingTime, isGraceFullShutdownEnabled);
|
return DoShutdownTimeLimitTest(appPoolBitness, valueOfshutdownTimeLimit, expectedClosingTime, isGraceFullShutdownEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -68,7 +68,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoStartupTimeLimitTest(appPoolBitness, starupTimeLimit);
|
return DoStartupTimeLimitTest(appPoolBitness, starupTimeLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -79,7 +79,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoRecycleApplicationAfterBackendProcessBeingKilled(appPoolBitness);
|
return DoRecycleApplicationAfterBackendProcessBeingKilled(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -90,7 +90,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoRecycleApplicationAfterW3WPProcessBeingKilled(appPoolBitness);
|
return DoRecycleApplicationAfterW3WPProcessBeingKilled(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -101,7 +101,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoRecycleApplicationAfterWebConfigUpdated(appPoolBitness);
|
return DoRecycleApplicationAfterWebConfigUpdated(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -112,7 +112,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoRecycleApplicationWithURLRewrite(appPoolBitness);
|
return DoRecycleApplicationWithURLRewrite(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -123,7 +123,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoRecycleParentApplicationWithURLRewrite(appPoolBitness);
|
return DoRecycleParentApplicationWithURLRewrite(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -140,7 +140,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoEnvironmentVariablesTest(environmentVariableName, environmentVariableValue, expectedEnvironmentVariableValue, appPoolBitness);
|
return DoEnvironmentVariablesTest(environmentVariableName, environmentVariableValue, expectedEnvironmentVariableValue, appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -151,7 +151,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoAppOfflineTestWithRenaming(appPoolBitness);
|
return DoAppOfflineTestWithRenaming(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -162,7 +162,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoAppOfflineTestWithUrlRewriteAndDeleting(appPoolBitness);
|
return DoAppOfflineTestWithUrlRewriteAndDeleting(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -173,7 +173,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoPostMethodTest(appPoolBitness, testData);
|
return DoPostMethodTest(appPoolBitness, testData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -195,7 +195,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoProcessesPerApplicationTest(appPoolBitness, valueOfProcessesPerApplication);
|
return DoProcessesPerApplicationTest(appPoolBitness, valueOfProcessesPerApplication);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -208,7 +208,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoRequestTimeoutTest(appPoolBitness, requestTimeout);
|
return DoRequestTimeoutTest(appPoolBitness, requestTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -219,7 +219,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoStdoutLogEnabledTest(appPoolBitness);
|
return DoStdoutLogEnabledTest(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -232,7 +232,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoProcessPathAndArgumentsTest(appPoolBitness, processPath, argumentsPrefix);
|
return DoProcessPathAndArgumentsTest(appPoolBitness, processPath, argumentsPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -258,7 +258,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoCompressionTest(appPoolBitness, useCompressionMiddleWare, enableIISCompression);
|
return DoCompressionTest(appPoolBitness, useCompressionMiddleWare, enableIISCompression);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
@ -269,7 +269,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
return DoCachingTest(appPoolBitness);
|
return DoCachingTest(appPoolBitness);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
[ANCMTestSkipCondition("%ANCMTestFlags%")]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
|
||||||
|
|
@ -898,8 +898,8 @@ namespace AspNetCoreModule.Test
|
||||||
requestHeaders = await GetResponse(testSite.AspNetCoreApp.GetUri("DumpRequestHeaders"), HttpStatusCode.OK);
|
requestHeaders = await GetResponse(testSite.AspNetCoreApp.GetUri("DumpRequestHeaders"), HttpStatusCode.OK);
|
||||||
if (enabledForwardWindowsAuthToken)
|
if (enabledForwardWindowsAuthToken)
|
||||||
{
|
{
|
||||||
string expectedHeaderName = "MS-ASPNETCORE-WINAUTHTOKEN";
|
|
||||||
Assert.Contains(expectedHeaderName, requestHeaders.ToUpper());
|
Assert.Contains("MS-ASPNETCORE-WINAUTHTOKEN", requestHeaders.ToUpper());
|
||||||
|
|
||||||
result = await GetResponse(testSite.AspNetCoreApp.GetUri("ImpersonateMiddleware"), HttpStatusCode.OK);
|
result = await GetResponse(testSite.AspNetCoreApp.GetUri("ImpersonateMiddleware"), HttpStatusCode.OK);
|
||||||
bool compare = false;
|
bool compare = false;
|
||||||
|
|
@ -1376,8 +1376,8 @@ namespace AspNetCoreModule.Test
|
||||||
// Verify https request with client certificate includes the certificate header "MS-ASPNETCORE-CLIENTCERT"
|
// Verify https request with client certificate includes the certificate header "MS-ASPNETCORE-CLIENTCERT"
|
||||||
Uri targetHttpsUriForDumpRequestHeaders = testSite.AspNetCoreApp.GetUri("DumpRequestHeaders", sslPort, protocol: "https");
|
Uri targetHttpsUriForDumpRequestHeaders = testSite.AspNetCoreApp.GetUri("DumpRequestHeaders", sslPort, protocol: "https");
|
||||||
string outputRawContent = TestUtility.RunPowershellScript("( invoke-webrequest " + targetHttpsUriForDumpRequestHeaders.OriginalString + " -CertificateThumbprint " + thumbPrintForClientAuthentication + ").RawContent.ToString()");
|
string outputRawContent = TestUtility.RunPowershellScript("( invoke-webrequest " + targetHttpsUriForDumpRequestHeaders.OriginalString + " -CertificateThumbprint " + thumbPrintForClientAuthentication + ").RawContent.ToString()");
|
||||||
string expectedHeaderName = "MS-ASPNETCORE-CLIENTCERT";
|
|
||||||
Assert.Contains(expectedHeaderName, outputRawContent);
|
Assert.Contains("MS-ASPNETCORE-CLIENTCERT", outputRawContent);
|
||||||
|
|
||||||
// Get the value of MS-ASPNETCORE-CLIENTCERT request header again and verify it is matched to its configured public key
|
// Get the value of MS-ASPNETCORE-CLIENTCERT request header again and verify it is matched to its configured public key
|
||||||
Uri targetHttpsUriForCLIENTCERTRequestHeader = testSite.AspNetCoreApp.GetUri("GetRequestHeaderValueMS-ASPNETCORE-CLIENTCERT", sslPort, protocol: "https");
|
Uri targetHttpsUriForCLIENTCERTRequestHeader = testSite.AspNetCoreApp.GetUri("GetRequestHeaderValueMS-ASPNETCORE-CLIENTCERT", sslPort, protocol: "https");
|
||||||
|
|
@ -2251,7 +2251,7 @@ namespace AspNetCoreModule.Test
|
||||||
{
|
{
|
||||||
postHttpContent = new FormUrlEncodedContent(postData);
|
postHttpContent = new FormUrlEncodedContent(postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numberOfRetryCount > 1 && expectedResponseStatus == HttpStatusCode.OK)
|
if (numberOfRetryCount > 1 && expectedResponseStatus == HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
if (postData == null)
|
if (postData == null)
|
||||||
|
|
@ -2337,7 +2337,6 @@ namespace AspNetCoreModule.Test
|
||||||
}
|
}
|
||||||
TestUtility.LogInformation(responseText);
|
TestUtility.LogInformation(responseText);
|
||||||
TestUtility.LogInformation(responseStatus);
|
TestUtility.LogInformation(responseStatus);
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,8 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<RuntimeFrameworkVersion>1.0.5</RuntimeFrameworkVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.*" />
|
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.WebSockets.Server" Version="0.1.*" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.WebListener" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.ResponseCaching" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.0.*" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.*" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Server.Kestrel.Https;
|
using Microsoft.AspNetCore.Server.Kestrel.Https;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Net.Http.Server;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
namespace AspnetCoreModule.TestSites.Standard
|
namespace AspnetCoreModule.TestSites.Standard
|
||||||
{
|
{
|
||||||
|
|
@ -25,7 +25,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
var config = new ConfigurationBuilder()
|
var config = new ConfigurationBuilder()
|
||||||
.AddCommandLine(args)
|
.AddCommandLine(args)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
string startUpClassString = Environment.GetEnvironmentVariable("ANCMTestStartupClassName");
|
string startUpClassString = Environment.GetEnvironmentVariable("ANCMTestStartupClassName");
|
||||||
IWebHostBuilder builder = null;
|
IWebHostBuilder builder = null;
|
||||||
if (!string.IsNullOrEmpty(startUpClassString))
|
if (!string.IsNullOrEmpty(startUpClassString))
|
||||||
|
|
@ -36,7 +36,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
string pfxPassword = "testPassword";
|
string pfxPassword = "testPassword";
|
||||||
if (File.Exists(@".\TestResources\testcert.pfx"))
|
if (File.Exists(@".\TestResources\testcert.pfx"))
|
||||||
{
|
{
|
||||||
_x509Certificate2 = new X509Certificate2(@".\TestResources\testcert.pfx", pfxPassword);
|
_x509Certificate2 = new X509Certificate2(@".\TestResources\testcert.pfx", pfxPassword);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -46,14 +46,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
builder = new WebHostBuilder()
|
builder = new WebHostBuilder()
|
||||||
.UseConfiguration(config)
|
.UseConfiguration(config)
|
||||||
.UseIISIntegration()
|
.UseIISIntegration()
|
||||||
.UseKestrel(options =>
|
.UseKestrel()
|
||||||
{
|
|
||||||
HttpsConnectionFilterOptions httpsoptions = new HttpsConnectionFilterOptions();
|
|
||||||
httpsoptions.ServerCertificate = _x509Certificate2;
|
|
||||||
httpsoptions.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
|
|
||||||
httpsoptions.CheckCertificateRevocation = false;
|
|
||||||
options.UseHttps(httpsoptions);
|
|
||||||
})
|
|
||||||
.UseStartup<Startup>();
|
.UseStartup<Startup>();
|
||||||
}
|
}
|
||||||
else if (startUpClassString == "StartupCompressionCaching")
|
else if (startUpClassString == "StartupCompressionCaching")
|
||||||
|
|
@ -116,33 +109,8 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
{
|
{
|
||||||
Startup.SleeptimeWhileClosing = Convert.ToInt32(shutdownDelay);
|
Startup.SleeptimeWhileClosing = Convert.ToInt32(shutdownDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch between Kestrel and WebListener for different tests. Default to Kestrel for normal app execution.
|
builder.UseKestrel();
|
||||||
if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
if (string.Equals(builder.GetSetting("environment") ??
|
|
||||||
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"),
|
|
||||||
"NtlmAuthentication", System.StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
// Set up NTLM authentication for WebListener as follows.
|
|
||||||
// For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or
|
|
||||||
// modify the applicationHost.config to enable NTLM.
|
|
||||||
builder.UseWebListener(options =>
|
|
||||||
{
|
|
||||||
options.ListenerSettings.Authentication.AllowAnonymous = true;
|
|
||||||
options.ListenerSettings.Authentication.Schemes =
|
|
||||||
AuthenticationSchemes.Negotiate | AuthenticationSchemes.NTLM;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
builder.UseWebListener();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
builder.UseKestrel();
|
|
||||||
}
|
|
||||||
|
|
||||||
var host = builder.Build();
|
var host = builder.Build();
|
||||||
AappLifetime = (IApplicationLifetime)host.Services.GetService(typeof(IApplicationLifetime));
|
AappLifetime = (IApplicationLifetime)host.Services.GetService(typeof(IApplicationLifetime));
|
||||||
|
|
@ -152,7 +120,6 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
{
|
{
|
||||||
GracefulShutdownDelayTime = Convert.ToInt32(gracefulShutdownDelay);
|
GracefulShutdownDelayTime = Convert.ToInt32(gracefulShutdownDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
AappLifetime.ApplicationStarted.Register(
|
AappLifetime.ApplicationStarted.Register(
|
||||||
() => {
|
() => {
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
|
|
@ -178,7 +145,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
{
|
{
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Startup.SleeptimeWhileClosing != 0)
|
if (Startup.SleeptimeWhileClosing != 0)
|
||||||
{
|
{
|
||||||
Thread.Sleep(Startup.SleeptimeWhileClosing);
|
Thread.Sleep(Startup.SleeptimeWhileClosing);
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,6 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.Configure<IISOptions>(options => {
|
services.Configure<IISOptions>(options => {
|
||||||
// Considering the default value of ForwardWindowsAuthentication is true,
|
|
||||||
// the below line is not required at present, however keeping in case the default value is changed later.
|
|
||||||
options.ForwardWindowsAuthentication = true;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,7 +70,6 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
{
|
{
|
||||||
app.UseWebSockets(new WebSocketOptions
|
app.UseWebSockets(new WebSocketOptions
|
||||||
{
|
{
|
||||||
ReplaceFeature = true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
subApp.Use(async (context, next) =>
|
subApp.Use(async (context, next) =>
|
||||||
|
|
@ -81,7 +77,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
if (context.WebSockets.IsWebSocketRequest)
|
if (context.WebSockets.IsWebSocketRequest)
|
||||||
{
|
{
|
||||||
var webSocket = await context.WebSockets.AcceptWebSocketAsync("mywebsocketsubprotocol");
|
var webSocket = await context.WebSockets.AcceptWebSocketAsync("mywebsocketsubprotocol");
|
||||||
await Echo(webSocket);
|
await Echo(webSocket);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -96,7 +92,6 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
{
|
{
|
||||||
app.UseWebSockets(new WebSocketOptions
|
app.UseWebSockets(new WebSocketOptions
|
||||||
{
|
{
|
||||||
ReplaceFeature = true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
subApp.Use(async (context, next) =>
|
subApp.Use(async (context, next) =>
|
||||||
|
|
@ -123,7 +118,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
return context.Response.WriteAsync(process.Id.ToString());
|
return context.Response.WriteAsync(process.Id.ToString());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.Map("/EchoPostData", subApp =>
|
app.Map("/EchoPostData", subApp =>
|
||||||
{
|
{
|
||||||
subApp.Run(context =>
|
subApp.Run(context =>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
@ -47,18 +48,19 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return context.Authentication.ChallengeAsync();
|
return context.ChallengeAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.Request.Path.Equals("/Forbidden"))
|
if (context.Request.Path.Equals("/Forbidden"))
|
||||||
{
|
{
|
||||||
return context.Authentication.ForbidAsync(Microsoft.AspNetCore.Http.Authentication.AuthenticationManager.AutomaticScheme);
|
return context.ForbidAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.Request.Path.Equals("/AutoForbid"))
|
if (context.Request.Path.Equals("/AutoForbid"))
|
||||||
{
|
{
|
||||||
return context.Authentication.ChallengeAsync();
|
return context.ChallengeAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.Request.Path.Equals("/RestrictedNegotiate"))
|
if (context.Request.Path.Equals("/RestrictedNegotiate"))
|
||||||
|
|
@ -69,7 +71,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return context.Authentication.ChallengeAsync("Negotiate");
|
return context.ChallengeAsync("Negotiate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,7 +83,7 @@ namespace AspnetCoreModule.TestSites.Standard
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return context.Authentication.ChallengeAsync("NTLM");
|
return context.ChallengeAsync("NTLM");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue