Updating Xunit and dotnet versions (#143)

This commit is contained in:
Justin Kotalik 2017-09-25 15:10:31 -07:00 committed by GitHub
parent 2e540341db
commit f130330db8
9 changed files with 55 additions and 99 deletions

View File

@ -2,7 +2,8 @@
<PropertyGroup>
<AspNetCoreVersion>1.2.0-*</AspNetCoreVersion>
<InternalAspNetCoreSdkVersion>2.1.1-*</InternalAspNetCoreSdkVersion>
<TestSdkVersion>15.3.0-*</TestSdkVersion>
<XunitVersion>2.3.0-beta2-*</XunitVersion>
<TestSdkVersion>15.3.0</TestSdkVersion>
<XunitAnalyzersVersion>0.6.1</XunitAnalyzersVersion>
<XunitVersion>2.3.0-beta4-build3742</XunitVersion>
</PropertyGroup>
</Project>

View File

@ -1063,17 +1063,22 @@ Finished:
if (strEventMsg.IsEmpty())
{
if (!fDonePrepareCommandLine)
{
strEventMsg.SafeSnwprintf(
m_struAppFullPath.QueryStr(),
ASPNETCORE_EVENT_PROCESS_START_INTERNAL_ERROR_MSG,
hr);
m_struAppFullPath.QueryStr(),
ASPNETCORE_EVENT_PROCESS_START_INTERNAL_ERROR_MSG,
hr);
}
else
{
strEventMsg.SafeSnwprintf(
ASPNETCORE_EVENT_PROCESS_START_POSTCREATE_ERROR_MSG,
m_struAppFullPath.QueryStr(),
m_pszRootApplicationPath.QueryStr(),
struCommandLine.QueryStr(),
hr);
}
}
apsz[0] = strEventMsg.QueryStr();

View File

@ -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");
//

View File

@ -21,7 +21,7 @@ namespace AspNetCoreModule.Test
{
await DoBasicTest(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -34,7 +34,7 @@ namespace AspNetCoreModule.Test
{
return DoRapidFailsPerMinuteTest(appPoolBitness, valueOfRapidFailsPerMinute);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -55,7 +55,7 @@ namespace AspNetCoreModule.Test
{
return DoShutdownTimeLimitTest(appPoolBitness, valueOfshutdownTimeLimit, expectedClosingTime, isGraceFullShutdownEnabled);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -68,7 +68,7 @@ namespace AspNetCoreModule.Test
{
return DoStartupTimeLimitTest(appPoolBitness, starupTimeLimit);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -79,7 +79,7 @@ namespace AspNetCoreModule.Test
{
return DoRecycleApplicationAfterBackendProcessBeingKilled(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -90,7 +90,7 @@ namespace AspNetCoreModule.Test
{
return DoRecycleApplicationAfterW3WPProcessBeingKilled(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -101,7 +101,7 @@ namespace AspNetCoreModule.Test
{
return DoRecycleApplicationAfterWebConfigUpdated(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -112,7 +112,7 @@ namespace AspNetCoreModule.Test
{
return DoRecycleApplicationWithURLRewrite(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -123,7 +123,7 @@ namespace AspNetCoreModule.Test
{
return DoRecycleParentApplicationWithURLRewrite(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -140,7 +140,7 @@ namespace AspNetCoreModule.Test
{
return DoEnvironmentVariablesTest(environmentVariableName, environmentVariableValue, expectedEnvironmentVariableValue, appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -151,7 +151,7 @@ namespace AspNetCoreModule.Test
{
return DoAppOfflineTestWithRenaming(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -162,7 +162,7 @@ namespace AspNetCoreModule.Test
{
return DoAppOfflineTestWithUrlRewriteAndDeleting(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -173,7 +173,7 @@ namespace AspNetCoreModule.Test
{
return DoPostMethodTest(appPoolBitness, testData);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -195,7 +195,7 @@ namespace AspNetCoreModule.Test
{
return DoProcessesPerApplicationTest(appPoolBitness, valueOfProcessesPerApplication);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -208,7 +208,7 @@ namespace AspNetCoreModule.Test
{
return DoRequestTimeoutTest(appPoolBitness, requestTimeout);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -219,7 +219,7 @@ namespace AspNetCoreModule.Test
{
return DoStdoutLogEnabledTest(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -232,7 +232,7 @@ namespace AspNetCoreModule.Test
{
return DoProcessPathAndArgumentsTest(appPoolBitness, processPath, argumentsPrefix);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -258,7 +258,7 @@ namespace AspNetCoreModule.Test
{
return DoCompressionTest(appPoolBitness, useCompressionMiddleWare, enableIISCompression);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]
@ -269,7 +269,7 @@ namespace AspNetCoreModule.Test
{
return DoCachingTest(appPoolBitness);
}
[ConditionalTheory]
[ANCMTestSkipCondition("%ANCMTestFlags%")]
[OSSkipCondition(OperatingSystems.Linux)]

View File

@ -898,8 +898,8 @@ namespace AspNetCoreModule.Test
requestHeaders = await GetResponse(testSite.AspNetCoreApp.GetUri("DumpRequestHeaders"), HttpStatusCode.OK);
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);
bool compare = false;
@ -1376,8 +1376,8 @@ namespace AspNetCoreModule.Test
// Verify https request with client certificate includes the certificate header "MS-ASPNETCORE-CLIENTCERT"
Uri targetHttpsUriForDumpRequestHeaders = testSite.AspNetCoreApp.GetUri("DumpRequestHeaders", sslPort, protocol: "https");
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
Uri targetHttpsUriForCLIENTCERTRequestHeader = testSite.AspNetCoreApp.GetUri("GetRequestHeaderValueMS-ASPNETCORE-CLIENTCERT", sslPort, protocol: "https");
@ -2251,7 +2251,7 @@ namespace AspNetCoreModule.Test
{
postHttpContent = new FormUrlEncodedContent(postData);
}
if (numberOfRetryCount > 1 && expectedResponseStatus == HttpStatusCode.OK)
{
if (postData == null)
@ -2337,7 +2337,6 @@ namespace AspNetCoreModule.Test
}
TestUtility.LogInformation(responseText);
TestUtility.LogInformation(responseStatus);
throw;
}
return result;
}

View File

@ -1,21 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<RuntimeFrameworkVersion>1.0.5</RuntimeFrameworkVersion>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.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.*" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
</ItemGroup>
</Project>

View File

@ -4,11 +4,11 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Https;
using Microsoft.Extensions.Configuration;
using Microsoft.Net.Http.Server;
using System;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Net;
namespace AspnetCoreModule.TestSites.Standard
{
@ -25,7 +25,7 @@ namespace AspnetCoreModule.TestSites.Standard
var config = new ConfigurationBuilder()
.AddCommandLine(args)
.Build();
string startUpClassString = Environment.GetEnvironmentVariable("ANCMTestStartupClassName");
IWebHostBuilder builder = null;
if (!string.IsNullOrEmpty(startUpClassString))
@ -36,7 +36,7 @@ namespace AspnetCoreModule.TestSites.Standard
string pfxPassword = "testPassword";
if (File.Exists(@".\TestResources\testcert.pfx"))
{
_x509Certificate2 = new X509Certificate2(@".\TestResources\testcert.pfx", pfxPassword);
_x509Certificate2 = new X509Certificate2(@".\TestResources\testcert.pfx", pfxPassword);
}
else
{
@ -46,14 +46,7 @@ namespace AspnetCoreModule.TestSites.Standard
builder = new WebHostBuilder()
.UseConfiguration(config)
.UseIISIntegration()
.UseKestrel(options =>
{
HttpsConnectionFilterOptions httpsoptions = new HttpsConnectionFilterOptions();
httpsoptions.ServerCertificate = _x509Certificate2;
httpsoptions.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
httpsoptions.CheckCertificateRevocation = false;
options.UseHttps(httpsoptions);
})
.UseKestrel()
.UseStartup<Startup>();
}
else if (startUpClassString == "StartupCompressionCaching")
@ -116,33 +109,8 @@ namespace AspnetCoreModule.TestSites.Standard
{
Startup.SleeptimeWhileClosing = Convert.ToInt32(shutdownDelay);
}
// Switch between Kestrel and WebListener for different tests. Default to Kestrel for normal app execution.
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();
}
builder.UseKestrel();
var host = builder.Build();
AappLifetime = (IApplicationLifetime)host.Services.GetService(typeof(IApplicationLifetime));
@ -152,7 +120,6 @@ namespace AspnetCoreModule.TestSites.Standard
{
GracefulShutdownDelayTime = Convert.ToInt32(gracefulShutdownDelay);
}
AappLifetime.ApplicationStarted.Register(
() => {
Thread.Sleep(1000);
@ -178,7 +145,7 @@ namespace AspnetCoreModule.TestSites.Standard
{
// ignore
}
if (Startup.SleeptimeWhileClosing != 0)
{
Thread.Sleep(Startup.SleeptimeWhileClosing);

View File

@ -28,9 +28,6 @@ namespace AspnetCoreModule.TestSites.Standard
public void ConfigureServices(IServiceCollection services)
{
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
{
ReplaceFeature = true
});
subApp.Use(async (context, next) =>
@ -81,7 +77,7 @@ namespace AspnetCoreModule.TestSites.Standard
if (context.WebSockets.IsWebSocketRequest)
{
var webSocket = await context.WebSockets.AcceptWebSocketAsync("mywebsocketsubprotocol");
await Echo(webSocket);
await Echo(webSocket);
}
else
{
@ -96,7 +92,6 @@ namespace AspnetCoreModule.TestSites.Standard
{
app.UseWebSockets(new WebSocketOptions
{
ReplaceFeature = true
});
subApp.Use(async (context, next) =>
@ -123,7 +118,7 @@ namespace AspnetCoreModule.TestSites.Standard
return context.Response.WriteAsync(process.Id.ToString());
});
});
app.Map("/EchoPostData", subApp =>
{
subApp.Run(context =>

View File

@ -2,6 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
@ -47,18 +48,19 @@ namespace AspnetCoreModule.TestSites.Standard
}
else
{
return context.Authentication.ChallengeAsync();
return context.ChallengeAsync();
}
}
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"))
{
return context.Authentication.ChallengeAsync();
return context.ChallengeAsync();
}
if (context.Request.Path.Equals("/RestrictedNegotiate"))
@ -69,7 +71,7 @@ namespace AspnetCoreModule.TestSites.Standard
}
else
{
return context.Authentication.ChallengeAsync("Negotiate");
return context.ChallengeAsync("Negotiate");
}
}
@ -81,7 +83,7 @@ namespace AspnetCoreModule.TestSites.Standard
}
else
{
return context.Authentication.ChallengeAsync("NTLM");
return context.ChallengeAsync("NTLM");
}
}