Merge pull request #1141 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
This commit is contained in:
commit
92cca2381f
|
|
@ -5,6 +5,14 @@ phases:
|
||||||
beforeBuild:
|
beforeBuild:
|
||||||
- powershell: "& ./tools/UpdateIISExpressCertificate.ps1; & ./tools/update_schema.ps1; Restart-Service w3svc"
|
- powershell: "& ./tools/UpdateIISExpressCertificate.ps1; & ./tools/update_schema.ps1; Restart-Service w3svc"
|
||||||
displayName: Prepare repo
|
displayName: Prepare repo
|
||||||
|
afterBuild:
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
displayName: Upload binlog
|
||||||
|
condition: always()
|
||||||
|
inputs:
|
||||||
|
artifactName: logs
|
||||||
|
artifactType: Container
|
||||||
|
pathtoPublish: artifacts/logs/
|
||||||
|
|
||||||
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
||||||
parameters:
|
parameters:
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
<AncmFiles Include="%(Components.PdbLocation)" Link="%(Components.BaseOutputPath)\%(Components.Platform)\%(Components.NativeAsset).pdb" />
|
<AncmFiles Include="%(Components.PdbLocation)" Link="%(Components.BaseOutputPath)\%(Components.Platform)\%(Components.NativeAsset).pdb" />
|
||||||
|
|
||||||
<!-- Schema-->
|
<!-- Schema-->
|
||||||
<AncmFiles Include="$(SourceBase)AspNetCoreModuleV1\AspNetCore\aspnetcore_schema.xml" Link="AspNetCoreModuleV1\aspnetcore_schema.xml" />
|
<AncmFiles Include="$(SourceBase)AspNetCoreModuleV2\AspNetCore\aspnetcore_schema_v2.xml" Link="AspNetCoreModuleV1\aspnetcore_schema.xml" />
|
||||||
<AncmFiles Include="$(SourceBase)AspNetCoreModuleV2\AspNetCore\aspnetcore_schema_v2.xml" Link="AspNetCoreModuleV2\aspnetcore_schema_v2.xml" />
|
<AncmFiles Include="$(SourceBase)AspNetCoreModuleV2\AspNetCore\aspnetcore_schema_v2.xml" Link="AspNetCoreModuleV2\aspnetcore_schema_v2.xml" />
|
||||||
<AncmFiles Include="$(SourceBase)AspNetCoreModuleV2\AspNetCore\ancm.mof" Link="AspNetCoreModuleV2\ancm.mof" />
|
<AncmFiles Include="$(SourceBase)AspNetCoreModuleV2\AspNetCore\ancm.mof" Link="AspNetCoreModuleV2\ancm.mof" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<file src="src\AspNetCoreModuleV1\AspNetCore\bin\$Configuration$\Win32\aspnetcore.pdb" target="contentFiles\any\any\x86\" />
|
<file src="src\AspNetCoreModuleV1\AspNetCore\bin\$Configuration$\Win32\aspnetcore.pdb" target="contentFiles\any\any\x86\" />
|
||||||
<file src="src\AspNetCoreModuleV1\AspNetCore\bin\$Configuration$\x64\aspnetcore.pdb" target="contentFiles\any\any\x64\" />
|
<file src="src\AspNetCoreModuleV1\AspNetCore\bin\$Configuration$\x64\aspnetcore.pdb" target="contentFiles\any\any\x64\" />
|
||||||
|
|
||||||
<file src="src\AspNetCoreModuleV1\AspNetCore\aspnetcore_schema.xml"/>
|
<file src="src\AspNetCoreModuleV2\AspNetCore\aspnetcore_schema_v2.xml" target="aspnetcore_schema.xml"/>
|
||||||
<file src="tools\installancm.ps1"/>
|
<file src="tools\installancm.ps1"/>
|
||||||
<file src="LICENSE.txt"/>
|
<file src="LICENSE.txt"/>
|
||||||
<file src="nuget\Microsoft.AspNetCore.AspNetCoreModule.props" target="build\" />
|
<file src="nuget\Microsoft.AspNetCore.AspNetCoreModule.props" target="build\" />
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||||
|
<InProcessTestSite>true</InProcessTestSite>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -213,14 +213,6 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Source.def" />
|
<None Include="Source.def" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="aspnetcore_schema.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Xml Include="aspnetcore_schema.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="src\application.cxx" />
|
<ClCompile Include="src\application.cxx" />
|
||||||
<ClCompile Include="src\applicationmanager.cxx" />
|
<ClCompile Include="src\applicationmanager.cxx" />
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
<!--
|
|
||||||
|
|
||||||
IIS Asp.Net Core Extension Schema
|
|
||||||
|
|
||||||
** Please DO NOT edit this file yourself. **
|
|
||||||
|
|
||||||
If you want to add configuration sections to the schema, you may place
|
|
||||||
them in .xml files similar to this one, in this directory. They will be
|
|
||||||
picked up automatically on startup.
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
<configSchema>
|
|
||||||
<sectionSchema name="system.webServer/aspNetCore">
|
|
||||||
<attribute name="processPath" type="string" expanded="true"/>
|
|
||||||
<attribute name="arguments" type="string" expanded="true" defaultValue=""/>
|
|
||||||
<attribute name="startupTimeLimit" type="uint" defaultValue="120" validationType="integerRange" validationParameter="0,3600"/> <!-- in seconds -->
|
|
||||||
<attribute name="shutdownTimeLimit" type="uint" defaultValue="10" validationType="integerRange" validationParameter="0,600"/> <!-- in seconds -->
|
|
||||||
<attribute name="rapidFailsPerMinute" type="uint" defaultValue="10" validationType="integerRange" validationParameter="0,100"/>
|
|
||||||
<attribute name="requestTimeout" type="timeSpan" defaultValue="00:02:00" validationType="timeSpanRange" validationParameter="0,1296000,60"/>
|
|
||||||
<attribute name="stdoutLogEnabled" type="bool" defaultValue="false" />
|
|
||||||
<attribute name="stdoutLogFile" type="string" defaultValue=".\aspnetcore-stdout" expanded="true"/>
|
|
||||||
<attribute name="processesPerApplication" type="uint" defaultValue="1" validationType="integerRange" validationParameter="1,100"/>
|
|
||||||
<attribute name="forwardWindowsAuthToken" type="bool" defaultValue="true" />
|
|
||||||
<attribute name="disableStartUpErrorPage" type="bool" defaultValue="false" />
|
|
||||||
<attribute name="hostingModel" type="string" />
|
|
||||||
<element name="recycleOnFileChange">
|
|
||||||
<collection addElement="file" clearElement="clear">
|
|
||||||
<attribute name="path" type="string" required="true" validationType="nonEmptyString" expanded="true"/>
|
|
||||||
</collection>
|
|
||||||
</element>
|
|
||||||
<element name="environmentVariables">
|
|
||||||
<collection addElement="environmentVariable" clearElement="clear" >
|
|
||||||
<attribute name="name" type="string" required="true" validationType="nonEmptyString"/>
|
|
||||||
<attribute name="value" type="string" required="true"/>
|
|
||||||
</collection>
|
|
||||||
</element>
|
|
||||||
</sectionSchema>
|
|
||||||
</configSchema>
|
|
||||||
|
|
@ -44,24 +44,40 @@ APPLICATION_MANAGER::GetOrCreateApplicationInfo(
|
||||||
// key in the applicationInfoHash.
|
// key in the applicationInfoHash.
|
||||||
pszApplicationId = pApplication.GetApplicationId();
|
pszApplicationId = pApplication.GetApplicationId();
|
||||||
|
|
||||||
// When accessing the m_pApplicationInfoHash, we need to acquire the application manager
|
|
||||||
// lock to avoid races on setting state.
|
|
||||||
SRWSharedLock lock(m_srwLock);
|
|
||||||
if (!m_fDebugInitialize)
|
|
||||||
{
|
{
|
||||||
DebugInitializeFromConfig(m_pHttpServer, pApplication);
|
// When accessing the m_pApplicationInfoHash, we need to acquire the application manager
|
||||||
m_fDebugInitialize = TRUE;
|
// lock to avoid races on setting state.
|
||||||
}
|
SRWSharedLock readLock(m_srwLock);
|
||||||
|
if (!m_fDebugInitialize)
|
||||||
|
{
|
||||||
|
DebugInitializeFromConfig(m_pHttpServer, pApplication);
|
||||||
|
m_fDebugInitialize = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_fInShutdown)
|
if (g_fInShutdown)
|
||||||
{
|
{
|
||||||
FINISHED(HRESULT_FROM_WIN32(ERROR_SERVER_SHUTDOWN_IN_PROGRESS));
|
FINISHED(HRESULT_FROM_WIN32(ERROR_SERVER_SHUTDOWN_IN_PROGRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pApplicationInfoHash->FindKey(pszApplicationId, ppApplicationInfo);
|
m_pApplicationInfoHash->FindKey(pszApplicationId, ppApplicationInfo);
|
||||||
|
|
||||||
|
// It's important to release read lock here so exclusive lock
|
||||||
|
// can be reacquired later as SRW lock doesn't allow upgrades
|
||||||
|
}
|
||||||
|
|
||||||
if (*ppApplicationInfo == NULL)
|
if (*ppApplicationInfo == NULL)
|
||||||
{
|
{
|
||||||
|
// Take exclusive lock before creating the application
|
||||||
|
SRWExclusiveLock writeLock(m_srwLock);
|
||||||
|
|
||||||
|
// Check if other thread created the application
|
||||||
|
|
||||||
|
m_pApplicationInfoHash->FindKey(pszApplicationId, ppApplicationInfo);
|
||||||
|
if (*ppApplicationInfo != NULL)
|
||||||
|
{
|
||||||
|
FINISHED(S_OK);
|
||||||
|
}
|
||||||
|
|
||||||
pApplicationInfo = new APPLICATION_INFO(m_pHttpServer);
|
pApplicationInfo = new APPLICATION_INFO(m_pHttpServer);
|
||||||
|
|
||||||
FINISHED_IF_FAILED(pApplicationInfo->Initialize(pApplication));
|
FINISHED_IF_FAILED(pApplicationInfo->Initialize(pApplication));
|
||||||
|
|
@ -187,7 +203,7 @@ APPLICATION_MANAGER::RecycleApplicationFromManager(
|
||||||
DWORD dwPreviousCounter = 0;
|
DWORD dwPreviousCounter = 0;
|
||||||
APPLICATION_INFO_HASH* table = NULL;
|
APPLICATION_INFO_HASH* table = NULL;
|
||||||
CONFIG_CHANGE_CONTEXT context;
|
CONFIG_CHANGE_CONTEXT context;
|
||||||
|
|
||||||
if (g_fInShutdown)
|
if (g_fInShutdown)
|
||||||
{
|
{
|
||||||
// We are already shutting down, ignore this event as a global configuration change event
|
// We are already shutting down, ignore this event as a global configuration change event
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "GlobalVersionUtility.h"
|
#include "GlobalVersionUtility.h"
|
||||||
|
|
||||||
namespace fs = std::experimental::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
// throws runtime error if no request handler versions are installed.
|
// throws runtime error if no request handler versions are installed.
|
||||||
// Throw invalid_argument if any argument is null
|
// Throw invalid_argument if any argument is null
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ PollingAppOfflineApplication::AppOfflineExists()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::experimental::filesystem::path PollingAppOfflineApplication::GetAppOfflineLocation(IHttpApplication& pApplication)
|
std::filesystem::path PollingAppOfflineApplication::GetAppOfflineLocation(IHttpApplication& pApplication)
|
||||||
{
|
{
|
||||||
return std::experimental::filesystem::path(pApplication.GetApplicationPhysicalPath()) / "app_offline.htm";
|
return std::filesystem::path(pApplication.GetApplicationPhysicalPath()) / "app_offline.htm";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ public:
|
||||||
void Stop(bool fServerInitiated) override { UNREFERENCED_PARAMETER(fServerInitiated); }
|
void Stop(bool fServerInitiated) override { UNREFERENCED_PARAMETER(fServerInitiated); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::experimental::filesystem::path m_appOfflineLocation;
|
std::filesystem::path m_appOfflineLocation;
|
||||||
static std::experimental::filesystem::path GetAppOfflineLocation(IHttpApplication& pApplication);
|
static std::filesystem::path GetAppOfflineLocation(IHttpApplication& pApplication);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int c_appOfflineRefreshIntervalMS = 200;
|
static const int c_appOfflineRefreshIntervalMS = 200;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
#include "HandleWrapper.h"
|
#include "HandleWrapper.h"
|
||||||
#include "Environment.h"
|
#include "Environment.h"
|
||||||
|
|
||||||
namespace fs = std::experimental::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Runs a standalone appliction.
|
// Runs a standalone appliction.
|
||||||
|
|
@ -98,7 +98,7 @@ HOSTFXR_UTILITY::GetStandaloneHostfxrParameters(
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
HOSTFXR_UTILITY::IsDotnetExecutable(const std::experimental::filesystem::path & dotnetPath)
|
HOSTFXR_UTILITY::IsDotnetExecutable(const std::filesystem::path & dotnetPath)
|
||||||
{
|
{
|
||||||
auto name = dotnetPath.filename();
|
auto name = dotnetPath.filename();
|
||||||
name.replace_extension("");
|
name.replace_extension("");
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public:
|
||||||
static
|
static
|
||||||
BOOL
|
BOOL
|
||||||
IsDotnetExecutable(
|
IsDotnetExecutable(
|
||||||
_In_ const std::experimental::filesystem::path & dotnetPath
|
_In_ const std::filesystem::path & dotnetPath
|
||||||
);
|
);
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
@ -74,25 +74,25 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
static
|
static
|
||||||
std::optional<std::experimental::filesystem::path>
|
std::optional<std::filesystem::path>
|
||||||
GetAbsolutePathToHostFxr(
|
GetAbsolutePathToHostFxr(
|
||||||
_In_ const std::experimental::filesystem::path & dotnetPath,
|
_In_ const std::filesystem::path & dotnetPath,
|
||||||
_In_ HANDLE hEventLog
|
_In_ HANDLE hEventLog
|
||||||
);
|
);
|
||||||
|
|
||||||
static
|
static
|
||||||
std::optional<std::experimental::filesystem::path>
|
std::optional<std::filesystem::path>
|
||||||
GetAbsolutePathToDotnetFromProgramFiles();
|
GetAbsolutePathToDotnetFromProgramFiles();
|
||||||
|
|
||||||
static
|
static
|
||||||
std::optional<std::experimental::filesystem::path>
|
std::optional<std::filesystem::path>
|
||||||
InvokeWhereToFindDotnet();
|
InvokeWhereToFindDotnet();
|
||||||
|
|
||||||
static
|
static
|
||||||
std::optional<std::experimental::filesystem::path>
|
std::optional<std::filesystem::path>
|
||||||
GetAbsolutePathToDotnet(
|
GetAbsolutePathToDotnet(
|
||||||
_In_ const std::experimental::filesystem::path & applicationPath,
|
_In_ const std::filesystem::path & applicationPath,
|
||||||
_In_ const std::experimental::filesystem::path & requestedPath
|
_In_ const std::filesystem::path & requestedPath
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,7 @@
|
||||||
<None Include="%(InProcessComponents.DllLocation)"
|
<None Include="%(InProcessComponents.DllLocation)"
|
||||||
Pack="true"
|
Pack="true"
|
||||||
PackagePath="runtimes/win-%(InProcessComponents.Platform)/nativeassets/$(NativeAssetsTargetFramework)" />
|
PackagePath="runtimes/win-%(InProcessComponents.Platform)/nativeassets/$(NativeAssetsTargetFramework)" />
|
||||||
<None Include="%(InProcessComponents.PdbLocation)"
|
|
||||||
Pack="true"
|
|
||||||
PackagePath="runtimes/win-%(InProcessComponents.Platform)/nativeassets/$(NativeAssetsTargetFramework)" />
|
|
||||||
<SignedPackageFile Include="%(InProcessComponents.NativeAsset)_%(InProcessComponents.Platform)"
|
<SignedPackageFile Include="%(InProcessComponents.NativeAsset)_%(InProcessComponents.Platform)"
|
||||||
PackagePath="runtimes/win-%(InProcessComponents.Platform)/nativeassets/$(NativeAssetsTargetFramework)/%(InProcessComponents.NativeAsset).dll"
|
PackagePath="runtimes/win-%(InProcessComponents.Platform)/nativeassets/$(NativeAssetsTargetFramework)/%(InProcessComponents.NativeAsset).dll"
|
||||||
Certificate="Microsoft" />
|
Certificate="Microsoft" />
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AspNetCoreModuleVersion Condition=" '$(AspNetCoreModuleVersion)' == '' ">V2</AspNetCoreModuleVersion>
|
<AspNetCoreModuleName Condition=" '$(AspNetCoreModuleName)' == '' ">AspNetCoreModuleV2</AspNetCoreModuleName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AspNetCoreModuleVersion Condition=" '$(AspNetCoreModuleVersion)' == '' ">V2</AspNetCoreModuleVersion>
|
<AspNetCoreModuleName Condition=" '$(AspNetCoreModuleName)' == '' ">AspNetCoreModuleV2</AspNetCoreModuleName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
internal class IISApplication
|
internal class IISApplication
|
||||||
{
|
{
|
||||||
internal const int ERROR_OBJECT_NOT_FOUND = unchecked((int)0x800710D8);
|
internal const int ERROR_OBJECT_NOT_FOUND = unchecked((int)0x800710D8);
|
||||||
|
internal const int ERROR_SHARING_VIOLATION = unchecked((int)0x80070020);
|
||||||
|
|
||||||
private static readonly TimeSpan _timeout = TimeSpan.FromSeconds(10);
|
private static readonly TimeSpan _timeout = TimeSpan.FromSeconds(10);
|
||||||
private static readonly TimeSpan _retryDelay = TimeSpan.FromMilliseconds(200);
|
private static readonly TimeSpan _retryDelay = TimeSpan.FromMilliseconds(200);
|
||||||
|
|
@ -109,7 +110,10 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
_logger.LogInformation($"Tried to start site, state: {state.ToString()}");
|
_logger.LogInformation($"Tried to start site, state: {state.ToString()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) when (ex is DllNotFoundException || (ex is COMException && ex.HResult == ERROR_OBJECT_NOT_FOUND) )
|
catch (Exception ex) when (
|
||||||
|
ex is DllNotFoundException ||
|
||||||
|
ex is COMException &&
|
||||||
|
(ex.HResult == ERROR_OBJECT_NOT_FOUND || ex.HResult == ERROR_SHARING_VIOLATION))
|
||||||
{
|
{
|
||||||
// Accessing the site.State property while the site
|
// Accessing the site.State property while the site
|
||||||
// is starting up returns the COMException
|
// is starting up returns the COMException
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,6 @@
|
||||||
PackageCopyToOutput="true"
|
PackageCopyToOutput="true"
|
||||||
PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)"/>
|
PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)"/>
|
||||||
|
|
||||||
<Content Include="%(ShimComponents.PdbLocation)"
|
|
||||||
PackageCopyToOutput="true"
|
|
||||||
PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)" />
|
|
||||||
|
|
||||||
<SignedPackageFile Include="%(ShimComponents.NativeAsset)_%(ShimComponents.Platform)"
|
<SignedPackageFile Include="%(ShimComponents.NativeAsset)_%(ShimComponents.Platform)"
|
||||||
PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)%(ShimComponents.NativeAsset).dll"
|
PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)%(ShimComponents.NativeAsset).dll"
|
||||||
Certificate="Microsoft" />
|
Certificate="Microsoft" />
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -19,6 +20,8 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
[Collection(PublishedSitesCollection.Name)]
|
[Collection(PublishedSitesCollection.Name)]
|
||||||
public class AppOfflineTests : IISFunctionalTestBase
|
public class AppOfflineTests : IISFunctionalTestBase
|
||||||
{
|
{
|
||||||
|
private static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(100);
|
||||||
|
|
||||||
private readonly PublishedSitesFixture _fixture;
|
private readonly PublishedSitesFixture _fixture;
|
||||||
|
|
||||||
public AppOfflineTests(PublishedSitesFixture fixture)
|
public AppOfflineTests(PublishedSitesFixture fixture)
|
||||||
|
|
@ -94,7 +97,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
// 1. ANCM detects app_offline before it starts the request - if AssertAppOffline succeeds we've hit it
|
// 1. ANCM detects app_offline before it starts the request - if AssertAppOffline succeeds we've hit it
|
||||||
// 2. Intended scenario where app starts and then shuts down
|
// 2. Intended scenario where app starts and then shuts down
|
||||||
// In first case we remove app_offline and try again
|
// In first case we remove app_offline and try again
|
||||||
await Task.Delay(100);
|
await Task.Delay(RetryDelay);
|
||||||
|
|
||||||
AddAppOffline(deploymentResult.ContentRoot);
|
AddAppOffline(deploymentResult.ContentRoot);
|
||||||
|
|
||||||
|
|
@ -182,7 +185,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
() => AddAppOffline(deploymentResult.ContentRoot),
|
() => AddAppOffline(deploymentResult.ContentRoot),
|
||||||
e => Logger.LogError($"Failed to create app_offline : {e.Message}"),
|
e => Logger.LogError($"Failed to create app_offline : {e.Message}"),
|
||||||
retryCount: 3,
|
retryCount: 3,
|
||||||
retryDelayMilliseconds: 100);
|
retryDelayMilliseconds: RetryDelay.Milliseconds);
|
||||||
RemoveAppOffline(deploymentResult.ContentRoot);
|
RemoveAppOffline(deploymentResult.ContentRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -218,7 +221,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
() => File.Delete(Path.Combine(appPath, "app_offline.htm")),
|
() => File.Delete(Path.Combine(appPath, "app_offline.htm")),
|
||||||
e => Logger.LogError($"Failed to remove app_offline : {e.Message}"),
|
e => Logger.LogError($"Failed to remove app_offline : {e.Message}"),
|
||||||
retryCount: 3,
|
retryCount: 3,
|
||||||
retryDelayMilliseconds: 100);
|
retryDelayMilliseconds: RetryDelay.Milliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.")
|
private async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.")
|
||||||
|
|
@ -229,6 +232,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
{
|
{
|
||||||
// Keep retrying until app_offline is present.
|
// Keep retrying until app_offline is present.
|
||||||
response = await deploymentResult.HttpClient.GetAsync("HelloWorld");
|
response = await deploymentResult.HttpClient.GetAsync("HelloWorld");
|
||||||
|
await Task.Delay(RetryDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.Equal(HttpStatusCode.ServiceUnavailable, response.StatusCode);
|
Assert.Equal(HttpStatusCode.ServiceUnavailable, response.StatusCode);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
// 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;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities;
|
||||||
|
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
||||||
|
using Microsoft.AspNetCore.Server.IntegrationTesting.IIS;
|
||||||
|
using Microsoft.AspNetCore.Testing.xunit;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
{
|
||||||
|
[Collection(PublishedSitesCollection.Name)]
|
||||||
|
public class CommonStartupTests : IISFunctionalTestBase
|
||||||
|
{
|
||||||
|
private readonly PublishedSitesFixture _fixture;
|
||||||
|
|
||||||
|
public CommonStartupTests(PublishedSitesFixture fixture)
|
||||||
|
{
|
||||||
|
_fixture = fixture;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TestMatrix TestVariants
|
||||||
|
=> TestMatrix.ForServers(DeployerSelector.ServerType)
|
||||||
|
.WithTfms(Tfm.NetCoreApp22)
|
||||||
|
.WithAllApplicationTypes()
|
||||||
|
.WithAllAncmVersions()
|
||||||
|
.WithAllHostingModels();
|
||||||
|
|
||||||
|
[ConditionalTheory]
|
||||||
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task StartupStress(TestVariant variant)
|
||||||
|
{
|
||||||
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
|
|
||||||
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
await Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("Hello World", response.Content.ReadAsStringAsync().GetAwaiter().GetResult());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -41,7 +41,7 @@ namespace FileOutManagerStartupTests
|
||||||
wprintf(expected, out);
|
wprintf(expected, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto & p : std::experimental::filesystem::directory_iterator(tempDirectory.path()))
|
for (auto & p : std::filesystem::directory_iterator(tempDirectory.path()))
|
||||||
{
|
{
|
||||||
std::wstring filename(p.path().filename());
|
std::wstring filename(p.path().filename());
|
||||||
ASSERT_EQ(filename.substr(0, fileNamePrefix.size()), fileNamePrefix);
|
ASSERT_EQ(filename.substr(0, fileNamePrefix.size()), fileNamePrefix);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
namespace GlobalVersionTests
|
namespace GlobalVersionTests
|
||||||
{
|
{
|
||||||
using ::testing::Test;
|
using ::testing::Test;
|
||||||
namespace fs = std::experimental::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
class GlobalVersionTest : public Test
|
class GlobalVersionTest : public Test
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ TempDirectory::TempDirectory()
|
||||||
RPC_CSTR szUuid = NULL;
|
RPC_CSTR szUuid = NULL;
|
||||||
if (UuidToStringA(&uuid, &szUuid) == RPC_S_OK)
|
if (UuidToStringA(&uuid, &szUuid) == RPC_S_OK)
|
||||||
{
|
{
|
||||||
m_path = std::experimental::filesystem::temp_directory_path() / szUuid;
|
m_path = std::filesystem::temp_directory_path() / reinterpret_cast<PCHAR>(szUuid);
|
||||||
RpcStringFreeA(&szUuid);
|
RpcStringFreeA(&szUuid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -37,5 +37,5 @@ TempDirectory::TempDirectory()
|
||||||
|
|
||||||
TempDirectory::~TempDirectory()
|
TempDirectory::~TempDirectory()
|
||||||
{
|
{
|
||||||
std::experimental::filesystem::remove_all(m_path);
|
std::filesystem::remove_all(m_path);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,11 @@ public:
|
||||||
|
|
||||||
~TempDirectory();
|
~TempDirectory();
|
||||||
|
|
||||||
std::experimental::filesystem::path path() const
|
std::filesystem::path path() const
|
||||||
{
|
{
|
||||||
return m_path;
|
return m_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::experimental::filesystem::path m_path;
|
std::filesystem::path m_path;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,7 @@ $ancmSchemaFiles = @(
|
||||||
"aspnetcore_schema_v2.xml"
|
"aspnetcore_schema_v2.xml"
|
||||||
)
|
)
|
||||||
|
|
||||||
$ancmSchemaFileLocations = @(
|
$ancmSchemaFileLocation = Resolve-Path "$PSScriptRoot\..\src\AspNetCoreModuleV2\AspNetCore\aspnetcore_schema_v2.xml";
|
||||||
@(Resolve-Path "$PSScriptRoot\..\src\AspNetCoreModuleV1\AspNetCore\aspnetcore_schema.xml"),
|
|
||||||
@(Resolve-Path "$PSScriptRoot\..\src\AspNetCoreModuleV2\AspNetCore\aspnetcore_schema_v2.xml")
|
|
||||||
)
|
|
||||||
|
|
||||||
[bool]$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
|
[bool]$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
|
||||||
|
|
||||||
|
|
@ -46,7 +43,7 @@ if (-not $isAdmin -and -not $WhatIfPreference) {
|
||||||
for ($i=0; $i -lt $ancmSchemaFiles.Length; $i++)
|
for ($i=0; $i -lt $ancmSchemaFiles.Length; $i++)
|
||||||
{
|
{
|
||||||
$schemaFile = $ancmSchemaFiles[$i]
|
$schemaFile = $ancmSchemaFiles[$i]
|
||||||
$schemaSource = $ancmSchemaFileLocations[$i]
|
$schemaSource = $ancmSchemaFileLocation
|
||||||
|
|
||||||
$destinations = @(
|
$destinations = @(
|
||||||
"${env:ProgramFiles(x86)}\IIS Express\config\schema\",
|
"${env:ProgramFiles(x86)}\IIS Express\config\schema\",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue