Merge branch 'merge/release/2.2-to-master'
This commit is contained in:
commit
b2738831bd
|
|
@ -75,8 +75,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestTasks", "test\TestTasks
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebSites", "WebSites", "{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebSites", "WebSites", "{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OverriddenServerWebSite", "test\WebSites\OverriddenServerWebSite\OverriddenServerWebSite.csproj", "{FC2A97F8-A749-4C04-97D1-97500066A820}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommonLibTests", "test\CommonLibTests\CommonLibTests.vcxproj", "{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommonLibTests", "test\CommonLibTests\CommonLibTests.vcxproj", "{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCoreModuleV2", "AspNetCoreModuleV2", "{06CA2C2B-83B0-4D83-905A-E0C74790009E}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCoreModuleV2", "AspNetCoreModuleV2", "{06CA2C2B-83B0-4D83-905A-E0C74790009E}"
|
||||||
|
|
@ -103,8 +101,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InProcessRequestHandler", "
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OutOfProcessRequestHandler", "src\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj", "{7F87406C-A3C8-4139-A68D-E4C344294A67}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OutOfProcessRequestHandler", "src\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj", "{7F87406C-A3C8-4139-A68D-E4C344294A67}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartupExceptionWebSite", "test\WebSites\StartupExceptionWebSite\StartupExceptionWebSite.csproj", "{340C59FC-C682-4CBA-81F8-791821EC8EDE}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "test\gtest\gtest.vcxproj", "{CAC1267B-8778-4257-AAC6-CAF481723B01}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "test\gtest\gtest.vcxproj", "{CAC1267B-8778-4257-AAC6-CAF481723B01}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandlerLib", "src\AspNetCoreModuleV2\RequestHandlerLib\RequestHandlerLib.vcxproj", "{1533E271-F61B-441B-8B74-59FB61DF0552}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandlerLib", "src\AspNetCoreModuleV2\RequestHandlerLib\RequestHandlerLib.vcxproj", "{1533E271-F61B-441B-8B74-59FB61DF0552}"
|
||||||
|
|
@ -235,18 +231,6 @@ Global
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x64.Build.0 = Release|Any CPU
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.ActiveCfg = Release|Any CPU
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.Build.0 = Release|Any CPU
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|Any CPU.ActiveCfg = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|Any CPU.Build.0 = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|Any CPU.ActiveCfg = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|Any CPU.Build.0 = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x64.Build.0 = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x86.Build.0 = Release|x86
|
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.Build.0 = Debug|x64
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
|
@ -331,16 +315,6 @@ Global
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x64.Build.0 = Release|x64
|
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x64.Build.0 = Release|x64
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.ActiveCfg = Release|Win32
|
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.ActiveCfg = Release|Win32
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.Build.0 = Release|Win32
|
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.Build.0 = Release|Win32
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|Any CPU.ActiveCfg = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|Any CPU.ActiveCfg = Release|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x64.Build.0 = Release|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x86.Build.0 = Release|x86
|
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.ActiveCfg = Debug|x64
|
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.Build.0 = Debug|x64
|
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
|
@ -424,7 +398,6 @@ Global
|
||||||
{13FD8F12-FFBE-4D01-B4AC-444F2994B04F} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
{13FD8F12-FFBE-4D01-B4AC-444F2994B04F} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{06CA2C2B-83B0-4D83-905A-E0C74790009E} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD}
|
{06CA2C2B-83B0-4D83-905A-E0C74790009E} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD}
|
||||||
{EC82302F-D2F0-4727-99D1-EABC0DD9DC3B} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
{EC82302F-D2F0-4727-99D1-EABC0DD9DC3B} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
||||||
|
|
@ -434,7 +407,6 @@ Global
|
||||||
{48F46909-E76A-4788-BCE1-E543C0E140FE} = {622D35C9-627B-466E-8D15-752968CC79AF}
|
{48F46909-E76A-4788-BCE1-E543C0E140FE} = {622D35C9-627B-466E-8D15-752968CC79AF}
|
||||||
{D57EA297-6DC2-4BC0-8C91-334863327863} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
{D57EA297-6DC2-4BC0-8C91-334863327863} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
{7F87406C-A3C8-4139-A68D-E4C344294A67} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{CAC1267B-8778-4257-AAC6-CAF481723B01} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{1533E271-F61B-441B-8B74-59FB61DF0552} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
{1533E271-F61B-441B-8B74-59FB61DF0552} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
||||||
{D182103F-8405-4647-B158-C36F598657EF} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{D182103F-8405-4647-B158-C36F598657EF} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestTasks", "test\TestTasks
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebSites", "WebSites", "{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebSites", "WebSites", "{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OverriddenServerWebSite", "test\WebSites\OverriddenServerWebSite\OverriddenServerWebSite.csproj", "{FC2A97F8-A749-4C04-97D1-97500066A820}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommonLibTests", "test\CommonLibTests\CommonLibTests.vcxproj", "{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommonLibTests", "test\CommonLibTests\CommonLibTests.vcxproj", "{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCoreModuleV1", "AspNetCoreModuleV1", "{16E521CE-77F1-4B1C-A183-520A41C4F372}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCoreModuleV1", "AspNetCoreModuleV1", "{16E521CE-77F1-4B1C-A183-520A41C4F372}"
|
||||||
|
|
@ -111,8 +109,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InProcessRequestHandler", "
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OutOfProcessRequestHandler", "src\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj", "{7F87406C-A3C8-4139-A68D-E4C344294A67}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OutOfProcessRequestHandler", "src\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj", "{7F87406C-A3C8-4139-A68D-E4C344294A67}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartupExceptionWebSite", "test\WebSites\StartupExceptionWebSite\StartupExceptionWebSite.csproj", "{340C59FC-C682-4CBA-81F8-791821EC8EDE}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "test\gtest\gtest.vcxproj", "{CAC1267B-8778-4257-AAC6-CAF481723B01}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "test\gtest\gtest.vcxproj", "{CAC1267B-8778-4257-AAC6-CAF481723B01}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandlerLib", "src\AspNetCoreModuleV2\RequestHandlerLib\RequestHandlerLib.vcxproj", "{1533E271-F61B-441B-8B74-59FB61DF0552}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandlerLib", "src\AspNetCoreModuleV2\RequestHandlerLib\RequestHandlerLib.vcxproj", "{1533E271-F61B-441B-8B74-59FB61DF0552}"
|
||||||
|
|
@ -321,26 +317,6 @@ Global
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x64.Build.0 = Release|Any CPU
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.ActiveCfg = Release|Any CPU
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.Build.0 = Release|Any CPU
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|Any CPU.ActiveCfg = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|Any CPU.Build.0 = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|Any CPU.ActiveCfg = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|Any CPU.Build.0 = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|x64.ActiveCfg = Debug|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|x86.ActiveCfg = Debug|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|Any CPU.ActiveCfg = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|Any CPU.Build.0 = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|x64.ActiveCfg = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|x86.ActiveCfg = Release|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|Any CPU.ActiveCfg = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|Any CPU.Build.0 = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x64.Build.0 = Release|x64
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x86.Build.0 = Release|x86
|
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.Build.0 = Debug|x64
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
|
@ -541,22 +517,6 @@ Global
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x64.Build.0 = Release|x64
|
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x64.Build.0 = Release|x64
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.ActiveCfg = Release|Win32
|
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.ActiveCfg = Release|Win32
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.Build.0 = Release|Win32
|
{7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x86.Build.0 = Release|Win32
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|Any CPU.ActiveCfg = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeDebug|Any CPU.ActiveCfg = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeDebug|x64.ActiveCfg = Debug|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeDebug|x86.ActiveCfg = Debug|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeRelease|Any CPU.ActiveCfg = Release|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeRelease|x64.ActiveCfg = Release|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeRelease|x86.ActiveCfg = Release|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|Any CPU.ActiveCfg = Release|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x64.Build.0 = Release|x64
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x86.Build.0 = Release|x86
|
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.ActiveCfg = Debug|x64
|
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.Build.0 = Debug|x64
|
{CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
|
@ -692,7 +652,6 @@ Global
|
||||||
{13FD8F12-FFBE-4D01-B4AC-444F2994B04F} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
{13FD8F12-FFBE-4D01-B4AC-444F2994B04F} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
||||||
{064D860B-4D7C-4B1D-918F-E020F1B99E2A} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{064D860B-4D7C-4B1D-918F-E020F1B99E2A} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{744ACDC6-F6A0-4FF9-9421-F25C5F2DC520} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{FC2A97F8-A749-4C04-97D1-97500066A820} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
|
||||||
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{16E521CE-77F1-4B1C-A183-520A41C4F372} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD}
|
{16E521CE-77F1-4B1C-A183-520A41C4F372} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD}
|
||||||
{06CA2C2B-83B0-4D83-905A-E0C74790009E} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD}
|
{06CA2C2B-83B0-4D83-905A-E0C74790009E} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD}
|
||||||
|
|
@ -705,7 +664,6 @@ Global
|
||||||
{48F46909-E76A-4788-BCE1-E543C0E140FE} = {622D35C9-627B-466E-8D15-752968CC79AF}
|
{48F46909-E76A-4788-BCE1-E543C0E140FE} = {622D35C9-627B-466E-8D15-752968CC79AF}
|
||||||
{D57EA297-6DC2-4BC0-8C91-334863327863} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
{D57EA297-6DC2-4BC0-8C91-334863327863} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
||||||
{7F87406C-A3C8-4139-A68D-E4C344294A67} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
{7F87406C-A3C8-4139-A68D-E4C344294A67} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
||||||
{340C59FC-C682-4CBA-81F8-791821EC8EDE} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
|
|
||||||
{CAC1267B-8778-4257-AAC6-CAF481723B01} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{CAC1267B-8778-4257-AAC6-CAF481723B01} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
{1533E271-F61B-441B-8B74-59FB61DF0552} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
{1533E271-F61B-441B-8B74-59FB61DF0552} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
|
||||||
{1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
{1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,13 @@
|
||||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.IISIntegration\Microsoft.AspNetCore.Server.IISIntegration.csproj" />
|
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.IISIntegration\Microsoft.AspNetCore.Server.IISIntegration.csproj" />
|
||||||
<ProjectReference Include="..\..\test\IISExpress.FunctionalTests\IISExpress.FunctionalTests.csproj" />
|
<ProjectReference Include="..\..\test\IISExpress.FunctionalTests\IISExpress.FunctionalTests.csproj" />
|
||||||
<ProjectReference Include="..\..\test\IIS.Tests\IIS.Tests.csproj" />
|
<ProjectReference Include="..\..\test\IIS.Tests\IIS.Tests.csproj" />
|
||||||
<ProjectReference Include="..\..\test\WebSites\**\*.csproj">
|
<ProjectReference Include="..\..\test\WebSites\InProcessWebSite\InProcessWebSite.csproj">
|
||||||
|
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\test\WebSites\OutOfProcessWebSite\OutOfProcessWebSite.csproj">
|
||||||
|
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\test\WebSites\StressTestWebSite\StressTestWebSite.csproj">
|
||||||
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,6 @@ simpleNode('Windows.10.Amd64.EnterpriseRS3.ASPNET.Open') {
|
||||||
stage ('Build') {
|
stage ('Build') {
|
||||||
def logFolder = getLogFolder()
|
def logFolder = getLogFolder()
|
||||||
def environment = "\$env:ASPNETCORE_TEST_LOG_DIR='${WORKSPACE}\\${logFolder}'"
|
def environment = "\$env:ASPNETCORE_TEST_LOG_DIR='${WORKSPACE}\\${logFolder}'"
|
||||||
bat "powershell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command \"&.\\tools\\update_schema.ps1;${environment};&.\\run.cmd -CI default-build /p:Configuration=${params.Configuration}\""
|
bat "powershell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command \"&.\\tools\\update_schema.ps1;&.\\tools\\UpdateIISExpressCertificate.ps1;${environment};&.\\run.cmd -CI default-build /p:Configuration=${params.Configuration}\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,7 @@
|
||||||
|
<<<<<<< HEAD
|
||||||
version:3.0.0-alpha1-20180907.9
|
version:3.0.0-alpha1-20180907.9
|
||||||
commithash:f997365a8832ff0a3cbd9a98df45734ac2723fa0
|
commithash:f997365a8832ff0a3cbd9a98df45734ac2723fa0
|
||||||
|
=======
|
||||||
|
version:2.2.0-preview1-20180907.8
|
||||||
|
commithash:078918eb5c1f176ee1da351c584fb4a4d7491aa0
|
||||||
|
>>>>>>> merge/release/2.2-to-master
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,10 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
|
||||||
|
|
||||||
protected override IEnumerable<Action<XElement, string>> GetWebConfigActions()
|
protected override IEnumerable<Action<XElement, string>> GetWebConfigActions()
|
||||||
{
|
{
|
||||||
|
yield return WebConfigHelpers.AddOrModifyAspNetCoreSection(
|
||||||
|
key: "hostingModel",
|
||||||
|
value: DeploymentParameters.HostingModel.ToString());
|
||||||
|
|
||||||
if (DeploymentParameters.ApplicationType == ApplicationType.Portable)
|
if (DeploymentParameters.ApplicationType == ApplicationType.Portable)
|
||||||
{
|
{
|
||||||
yield return WebConfigHelpers.AddOrModifyAspNetCoreSection(
|
yield return WebConfigHelpers.AddOrModifyAspNetCoreSection(
|
||||||
|
|
@ -126,15 +130,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
|
||||||
key: "modules",
|
key: "modules",
|
||||||
value: DeploymentParameters.AncmVersion.ToString());
|
value: DeploymentParameters.AncmVersion.ToString());
|
||||||
|
|
||||||
|
|
||||||
foreach (var action in base.GetWebConfigActions())
|
foreach (var action in base.GetWebConfigActions())
|
||||||
{
|
{
|
||||||
yield return action;
|
yield return action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void GetLogsFromFile()
|
private void GetLogsFromFile()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
|
||||||
// For published apps, prefer the content in the web.config, but update it.
|
// For published apps, prefer the content in the web.config, but update it.
|
||||||
yield return WebConfigHelpers.AddOrModifyAspNetCoreSection(
|
yield return WebConfigHelpers.AddOrModifyAspNetCoreSection(
|
||||||
key: "hostingModel",
|
key: "hostingModel",
|
||||||
value: DeploymentParameters.HostingModel == HostingModel.InProcess ? "inprocess" : "");
|
value: DeploymentParameters.HostingModel.ToString());
|
||||||
|
|
||||||
yield return WebConfigHelpers.AddOrModifyHandlerSection(
|
yield return WebConfigHelpers.AddOrModifyHandlerSection(
|
||||||
key: "modules",
|
key: "modules",
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
DeletePublishOutput(deploymentResult);
|
DeletePublishOutput(deploymentResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact(Skip = "https://github.com/aspnet/IISIntegration/issues/933")]
|
||||||
public async Task AppOfflineDroppedWhileSiteFailedToStartInRequestHandler_SiteStops_InProcess()
|
public async Task AppOfflineDroppedWhileSiteFailedToStartInRequestHandler_SiteStops_InProcess()
|
||||||
{
|
{
|
||||||
var deploymentResult = await DeployApp(HostingModel.InProcess);
|
var deploymentResult = await DeployApp(HostingModel.InProcess);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
// 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.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 LogPipeTests : IISFunctionalTestBase
|
||||||
|
{
|
||||||
|
private readonly PublishedSitesFixture _fixture;
|
||||||
|
|
||||||
|
public LogPipeTests(PublishedSitesFixture fixture)
|
||||||
|
{
|
||||||
|
_fixture = fixture;
|
||||||
|
}
|
||||||
|
|
||||||
|
[ConditionalTheory]
|
||||||
|
[InlineData("ConsoleErrorWrite")]
|
||||||
|
[InlineData("ConsoleWrite")]
|
||||||
|
public async Task CheckStdoutLoggingToPipe_DoesNotCrashProcess(string path)
|
||||||
|
{
|
||||||
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
||||||
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
await Helpers.AssertStarts(deploymentResult, path);
|
||||||
|
|
||||||
|
StopServer();
|
||||||
|
|
||||||
|
if (deploymentParameters.ServerType == ServerType.IISExpress)
|
||||||
|
{
|
||||||
|
Assert.Contains(TestSink.Writes, context => context.Message.Contains("TEST MESSAGE"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[ConditionalTheory]
|
||||||
|
[InlineData("ConsoleErrorWrite")]
|
||||||
|
[InlineData("ConsoleWrite")]
|
||||||
|
public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path)
|
||||||
|
{
|
||||||
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
||||||
|
|
||||||
|
var firstWriteString = path + path;
|
||||||
|
|
||||||
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_INITIAL_WRITE"] = firstWriteString;
|
||||||
|
|
||||||
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
await Helpers.AssertStarts(deploymentResult, path);
|
||||||
|
|
||||||
|
StopServer();
|
||||||
|
|
||||||
|
if (deploymentParameters.ServerType == ServerType.IISExpress)
|
||||||
|
{
|
||||||
|
// We can't read stdout logs from IIS as they aren't redirected.
|
||||||
|
Assert.Contains(TestSink.Writes, context => context.Message.Contains(firstWriteString));
|
||||||
|
Assert.Contains(TestSink.Writes, context => context.Message.Contains("TEST MESSAGE"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[ConditionalFact]
|
||||||
|
public async Task CheckUnicodePipe()
|
||||||
|
{
|
||||||
|
var path = "CheckConsoleFunctions";
|
||||||
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
||||||
|
|
||||||
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
var response = await deploymentResult.HttpClient.GetAsync(path);
|
||||||
|
|
||||||
|
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||||
|
|
||||||
|
StopServer();
|
||||||
|
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", "(.*)彡⾔(.*)"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -22,11 +22,11 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[InlineData("CheckLogFile")]
|
[InlineData("ConsoleWrite")]
|
||||||
[InlineData("CheckErrLogFile")]
|
[InlineData("ConsoleErrorWrite")]
|
||||||
public async Task CheckStdoutWithRandomNumber(string mode)
|
public async Task CheckStdoutWithRandomNumber(string mode)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
|
||||||
var randomNumberString = new Random(Guid.NewGuid().GetHashCode()).Next(10000000).ToString();
|
var randomNumberString = new Random(Guid.NewGuid().GetHashCode()).Next(10000000).ToString();
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {mode} {randomNumberString}");
|
deploymentParameters.TransformArguments((a, _) => $"{a} {mode} {randomNumberString}");
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData("CheckOversizedStdOutWrites")]
|
[InlineData("CheckOversizedStdOutWrites")]
|
||||||
public async Task CheckStdoutWithLargeWrites(string mode)
|
public async Task CheckStdoutWithLargeWrites(string mode)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {mode}");
|
deploymentParameters.TransformArguments((a, _) => $"{a} {mode}");
|
||||||
|
|
||||||
await AssertFailsToStart(deploymentParameters);
|
await AssertFailsToStart(deploymentParameters);
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task CheckValidConsoleFunctions()
|
public async Task CheckValidConsoleFunctions()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} CheckConsoleFunctions");
|
deploymentParameters.TransformArguments((a, _) => $"{a} CheckConsoleFunctions");
|
||||||
|
|
||||||
await AssertFailsToStart(deploymentParameters);
|
await AssertFailsToStart(deploymentParameters);
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
Assert.Contains(TestSink.Writes, context => context.Message.Contains("Is Console redirection: True"));
|
Assert.Contains(TestSink.Writes, context => context.Message.Contains("Is Console redirection: True"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AssertFailsToStart(IntegrationTesting.IIS.IISDeploymentParameters deploymentParameters)
|
private async Task AssertFailsToStart(IISDeploymentParameters deploymentParameters)
|
||||||
{
|
{
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -76,17 +76,17 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task Gets500_30_ErrorPage()
|
public async Task Gets500_30_ErrorPage()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
Assert.False(response.IsSuccessStatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||||
|
|
||||||
var responseText = await response.Content.ReadAsStringAsync();
|
var responseText = await response.Content.ReadAsStringAsync();
|
||||||
Assert.Contains("500.30 - ANCM In-Process Start Failure", responseText);
|
Assert.Contains("500.30 - ANCM In-Process Start Failure", responseText);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities;
|
using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities;
|
||||||
|
|
@ -35,13 +34,30 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
public static TestMatrix TestVariants
|
||||||
[InlineData("CheckErrLogFile")]
|
=> TestMatrix.ForServers(DeployerSelector.ServerType)
|
||||||
[InlineData("CheckLogFile")]
|
.WithTfms(Tfm.NetCoreApp22)
|
||||||
public async Task CheckStdoutLoggingToFile(string path)
|
.WithAllApplicationTypes()
|
||||||
{
|
.WithAncmVersions(AncmVersion.AspNetCoreModuleV2)
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
.WithAllHostingModels();
|
||||||
|
|
||||||
|
[ConditionalTheory]
|
||||||
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task CheckStdoutLoggingToFile(TestVariant variant)
|
||||||
|
{
|
||||||
|
await CheckStdoutToFile(variant, "ConsoleWrite");
|
||||||
|
}
|
||||||
|
|
||||||
|
[ConditionalTheory]
|
||||||
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task CheckStdoutErrLoggingToFile(TestVariant variant)
|
||||||
|
{
|
||||||
|
await CheckStdoutToFile(variant, "ConsoleErrorWrite");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task CheckStdoutToFile(TestVariant variant, string path)
|
||||||
|
{
|
||||||
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -52,14 +68,15 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
var contents = File.ReadAllText(Helpers.GetExpectedLogName(deploymentResult, _logFolderPath));
|
var contents = File.ReadAllText(Helpers.GetExpectedLogName(deploymentResult, _logFolderPath));
|
||||||
|
|
||||||
Assert.NotNull(contents);
|
|
||||||
Assert.Contains("TEST MESSAGE", contents);
|
Assert.Contains("TEST MESSAGE", contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
// Move to separate file
|
||||||
public async Task InvalidFilePathForLogs_ServerStillRuns()
|
[ConditionalTheory]
|
||||||
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task InvalidFilePathForLogs_ServerStillRuns(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
|
|
||||||
deploymentParameters.WebConfigActionList.Add(
|
deploymentParameters.WebConfigActionList.Add(
|
||||||
WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogEnabled", "true"));
|
WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogEnabled", "true"));
|
||||||
|
|
@ -71,29 +88,18 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
await Helpers.AssertStarts(deploymentResult, "HelloWorld");
|
await Helpers.AssertStarts(deploymentResult, "HelloWorld");
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
if (variant.HostingModel == HostingModel.InProcess)
|
||||||
|
{
|
||||||
EventLogHelpers.VerifyEventLogEvent(deploymentResult, "Could not start stdout redirection in (.*)aspnetcorev2.dll. Exception message: HRESULT 0x80070003");
|
EventLogHelpers.VerifyEventLogEvent(deploymentResult, "Could not start stdout redirection in (.*)aspnetcorev2.dll. Exception message: HRESULT 0x80070003");
|
||||||
EventLogHelpers.VerifyEventLogEvent(deploymentResult, "Could not stop stdout redirection in (.*)aspnetcorev2.dll. Exception message: HRESULT 0x80070002");
|
EventLogHelpers.VerifyEventLogEvent(deploymentResult, "Could not stop stdout redirection in (.*)aspnetcorev2.dll. Exception message: HRESULT 0x80070002");
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
|
||||||
public async Task OnlyOneFileCreatedWithProcessStartTime()
|
|
||||||
{
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
|
||||||
|
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
|
||||||
await Helpers.AssertStarts(deploymentResult, "CheckLogFile");
|
|
||||||
|
|
||||||
StopServer();
|
|
||||||
|
|
||||||
Assert.Single(Directory.GetFiles(_logFolderPath), Helpers.GetExpectedLogName(deploymentResult, _logFolderPath));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalTheory]
|
||||||
public async Task StartupMessagesAreLoggedIntoDebugLogFile()
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task StartupMessagesAreLoggedIntoDebugLogFile(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
||||||
deploymentParameters.HandlerSettings["debugFile"] = "debug.txt";
|
deploymentParameters.HandlerSettings["debugFile"] = "debug.txt";
|
||||||
|
|
||||||
|
|
@ -104,10 +110,11 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
AssertLogs(Path.Combine(deploymentResult.ContentRoot, "debug.txt"));
|
AssertLogs(Path.Combine(deploymentResult.ContentRoot, "debug.txt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalTheory]
|
||||||
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFile()
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFile(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -117,11 +124,12 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log"));
|
AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalTheory]
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFileWhenEnabledWithEnvVar()
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFileWhenEnabledWithEnvVar(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG"] = "file";
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG"] = "file";
|
||||||
// Add empty debugFile handler setting to prevent IIS deployer from overriding debug settings
|
// Add empty debugFile handler setting to prevent IIS deployer from overriding debug settings
|
||||||
deploymentParameters.HandlerSettings["debugFile"] = "";
|
deploymentParameters.HandlerSettings["debugFile"] = "";
|
||||||
|
|
@ -133,58 +141,16 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[InlineData("CheckErrLogFile")]
|
|
||||||
[InlineData("CheckLogFile")]
|
|
||||||
public async Task CheckStdoutLoggingToPipe_DoesNotCrashProcess(string path)
|
|
||||||
{
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
|
||||||
|
|
||||||
await Helpers.AssertStarts(deploymentResult, path);
|
|
||||||
|
|
||||||
StopServer();
|
|
||||||
|
|
||||||
if (deploymentParameters.ServerType == ServerType.IISExpress)
|
|
||||||
{
|
|
||||||
Assert.Contains(TestSink.Writes, context => context.Message.Contains("TEST MESSAGE"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[InlineData("CheckErrLogFile")]
|
|
||||||
[InlineData("CheckLogFile")]
|
|
||||||
public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path)
|
|
||||||
{
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
|
||||||
|
|
||||||
var firstWriteString = path + path;
|
|
||||||
|
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_INITIAL_WRITE"] = firstWriteString;
|
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
|
||||||
|
|
||||||
await Helpers.AssertStarts(deploymentResult, path);
|
|
||||||
|
|
||||||
StopServer();
|
|
||||||
|
|
||||||
if (deploymentParameters.ServerType == ServerType.IISExpress)
|
|
||||||
{
|
|
||||||
// We can't read stdout logs from IIS as they aren't redirected.
|
|
||||||
Assert.Contains(TestSink.Writes, context => context.Message.Contains(firstWriteString));
|
|
||||||
Assert.Contains(TestSink.Writes, context => context.Message.Contains("TEST MESSAGE"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalFact]
|
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task StartupMessagesLogFileSwitchedWhenLogFilePresentInWebConfig()
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task StartupMessagesLogFileSwitchedWhenLogFilePresentInWebConfig(TestVariant variant)
|
||||||
{
|
{
|
||||||
var firstTempFile = Path.GetTempFileName();
|
var firstTempFile = Path.GetTempFileName();
|
||||||
var secondTempFile = Path.GetTempFileName();
|
var secondTempFile = Path.GetTempFileName();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG_FILE"] = firstTempFile;
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG_FILE"] = firstTempFile;
|
||||||
deploymentParameters.AddDebugLogToWebConfig(secondTempFile);
|
deploymentParameters.AddDebugLogToWebConfig(secondTempFile);
|
||||||
|
|
||||||
|
|
@ -205,68 +171,65 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalTheory]
|
||||||
public async Task DebugLogsAreWrittenToEventLog()
|
[MemberData(nameof(TestVariants))]
|
||||||
|
|
||||||
|
public async Task DebugLogsAreWrittenToEventLog(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
deploymentParameters.HandlerSettings["debugLevel"] = "file,eventlog";
|
deploymentParameters.HandlerSettings["debugLevel"] = "file,eventlog";
|
||||||
var deploymentResult = await StartAsync(deploymentParameters);
|
var deploymentResult = await StartAsync(deploymentParameters);
|
||||||
StopServer();
|
StopServer();
|
||||||
EventLogHelpers.VerifyEventLogEvent(deploymentResult, @"\[aspnetcorev2.dll\] Initializing logs for .*?Description: IIS ASP.NET Core Module V2");
|
EventLogHelpers.VerifyEventLogEvent(deploymentResult, @"\[aspnetcorev2.dll\] Initializing logs for .*?Description: IIS ASP.NET Core Module V2");
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalTheory]
|
||||||
public async Task OutOfProcessReadsLogConfiguration()
|
[MemberData(nameof(TestVariants))]
|
||||||
{
|
public async Task CheckUTF8File(TestVariant variant)
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel:HostingModel.OutOfProcess, publish: true);
|
|
||||||
deploymentParameters.HandlerSettings["debugLevel"] = "file,trace";
|
|
||||||
deploymentParameters.HandlerSettings["debugFile"] = "";
|
|
||||||
var deploymentResult = await StartAsync(deploymentParameters);
|
|
||||||
|
|
||||||
var logContents = ReadLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log"));
|
|
||||||
Assert.Contains("FORWARDING_HANDLER::", logContents);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalFact]
|
|
||||||
public async Task CheckUnicodePipe()
|
|
||||||
{
|
{
|
||||||
var path = "CheckConsoleFunctions";
|
var path = "CheckConsoleFunctions";
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, variant.HostingModel, publish: true);
|
||||||
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}"); // For standalone this will need to remove space
|
||||||
|
|
||||||
|
var logFolderPath = _logFolderPath + "\\彡⾔";
|
||||||
|
deploymentParameters.EnableLogging(logFolderPath);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync(path);
|
var response = await deploymentResult.HttpClient.GetAsync(path);
|
||||||
|
|
||||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
||||||
|
var contents = File.ReadAllText(Helpers.GetExpectedLogName(deploymentResult, logFolderPath));
|
||||||
|
Assert.Contains("彡⾔", contents);
|
||||||
|
|
||||||
|
if (variant.HostingModel == HostingModel.InProcess)
|
||||||
|
{
|
||||||
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", "(.*)彡⾔(.*)"));
|
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", "(.*)彡⾔(.*)"));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
[ConditionalFact]
|
|
||||||
public async Task CheckUTF8File()
|
|
||||||
{
|
{
|
||||||
var path = "CheckConsoleFunctions";
|
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.OutOfProcessFailedToStart(deploymentResult));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
[ConditionalTheory]
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
[MemberData(nameof(TestVariants))]
|
||||||
|
public async Task OnlyOneFileCreatedWithProcessStartTime(TestVariant variant)
|
||||||
|
{
|
||||||
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
||||||
|
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
await Helpers.AssertStarts(deploymentResult, "ConsoleWrite");
|
||||||
var response = await deploymentResult.HttpClient.GetAsync(path);
|
|
||||||
|
|
||||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
||||||
var contents = File.ReadAllText(Helpers.GetExpectedLogName(deploymentResult, _logFolderPath));
|
Assert.Single(Directory.GetFiles(_logFolderPath), Helpers.GetExpectedLogName(deploymentResult, _logFolderPath));
|
||||||
|
|
||||||
Assert.Contains("彡⾔", contents);
|
|
||||||
|
|
||||||
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", "(.*)彡⾔(.*)"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ReadLogs(string logPath)
|
private static string ReadLogs(string logPath)
|
||||||
|
|
@ -282,7 +245,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
var logContents = ReadLogs(logPath);
|
var logContents = ReadLogs(logPath);
|
||||||
Assert.Contains("[aspnetcorev2.dll]", logContents);
|
Assert.Contains("[aspnetcorev2.dll]", logContents);
|
||||||
Assert.Contains("[aspnetcorev2_inprocess.dll]", logContents);
|
Assert.True(logContents.Contains("[aspnetcorev2_inprocess.dll]") || logContents.Contains("[aspnetcorev2_outofprocess.dll]"));
|
||||||
Assert.Contains("Description: IIS ASP.NET Core Module V2. Commit:", logContents);
|
Assert.Contains("Description: IIS ASP.NET Core Module V2. Commit:", logContents);
|
||||||
Assert.Contains("Description: IIS ASP.NET Core Module V2 Request Handler. Commit:", logContents);
|
Assert.Contains("Description: IIS ASP.NET Core Module V2 Request Handler. Commit:", logContents);
|
||||||
}
|
}
|
||||||
|
|
@ -21,15 +21,11 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
public CachingApplicationPublisher InProcessTestSite { get; } = new CachingApplicationPublisher(Helpers.GetInProcessTestSitesPath());
|
public CachingApplicationPublisher InProcessTestSite { get; } = new CachingApplicationPublisher(Helpers.GetInProcessTestSitesPath());
|
||||||
public CachingApplicationPublisher OutOfProcessTestSite { get; } = new CachingApplicationPublisher(Helpers.GetOutOfProcessTestSitesPath());
|
public CachingApplicationPublisher OutOfProcessTestSite { get; } = new CachingApplicationPublisher(Helpers.GetOutOfProcessTestSitesPath());
|
||||||
public CachingApplicationPublisher StartupExceptionWebsite { get; } = new CachingApplicationPublisher(Helpers.GetTestWebSitePath("StartupExceptionWebsite"));
|
|
||||||
public CachingApplicationPublisher OverriddenServerWebSite { get; } = new CachingApplicationPublisher(Helpers.GetTestWebSitePath("OverriddenServerWebSite"));
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
InProcessTestSite.Dispose();
|
InProcessTestSite.Dispose();
|
||||||
OutOfProcessTestSite.Dispose();
|
OutOfProcessTestSite.Dispose();
|
||||||
StartupExceptionWebsite.Dispose();
|
|
||||||
OverriddenServerWebSite.Dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IISDeploymentParameters GetBaseDeploymentParameters(HostingModel hostingModel = HostingModel.InProcess, bool publish = false)
|
public IISDeploymentParameters GetBaseDeploymentParameters(HostingModel hostingModel = HostingModel.InProcess, bool publish = false)
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
return $"Configuration load error. {reason}";
|
return $"Configuration load error. {reason}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string OutOfProcessFailedToStart(IISDeploymentResult deploymentResult)
|
||||||
|
{
|
||||||
|
return $"Application '/LM/W3SVC/1/ROOT' with physical root '{EscapedContentRoot(deploymentResult)}' failed to start process with " +
|
||||||
|
$"commandline '(.*)' with multiple retries. " +
|
||||||
|
$"The last try of listening port is '(.*)'. See previous warnings for details.";
|
||||||
|
}
|
||||||
|
|
||||||
private static string EscapedContentRoot(IISDeploymentResult deploymentResult)
|
private static string EscapedContentRoot(IISDeploymentResult deploymentResult)
|
||||||
{
|
{
|
||||||
var contentRoot = deploymentResult.ContentRoot;
|
var contentRoot = deploymentResult.ContentRoot;
|
||||||
|
|
|
||||||
|
|
@ -146,10 +146,18 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public static string GetExpectedLogName(IISDeploymentResult deploymentResult, string logFolderPath)
|
public static string GetExpectedLogName(IISDeploymentResult deploymentResult, string logFolderPath)
|
||||||
{
|
{
|
||||||
var startTime = deploymentResult.HostProcess.StartTime.ToUniversalTime();
|
var startTime = deploymentResult.HostProcess.StartTime.ToUniversalTime();
|
||||||
|
|
||||||
|
if (deploymentResult.DeploymentParameters.HostingModel == HostingModel.InProcess)
|
||||||
|
{
|
||||||
return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" +
|
return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" +
|
||||||
$"{startTime.Day:D2}{startTime.Hour:D2}" +
|
$"{startTime.Day:D2}{startTime.Hour:D2}" +
|
||||||
$"{startTime.Minute:D2}{startTime.Second:D2}_" +
|
$"{startTime.Minute:D2}{startTime.Second:D2}_" +
|
||||||
$"{deploymentResult.HostProcess.Id}.log");
|
$"{deploymentResult.HostProcess.Id}.log");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Directory.GetFiles(logFolderPath).Single();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,13 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj" />
|
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj" />
|
||||||
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
|
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
|
||||||
<ProjectReference Include="..\WebSites\**\*.csproj">
|
<ProjectReference Include="..\WebSites\InProcessWebSite\InProcessWebSite.csproj">
|
||||||
|
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\WebSites\OutOfProcessWebSite\OutOfProcessWebSite.csproj">
|
||||||
|
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\WebSites\StressTestWebSite\StressTestWebSite.csproj">
|
||||||
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities;
|
using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities;
|
||||||
using Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests;
|
using Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests;
|
||||||
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
|
||||||
using Microsoft.AspNetCore.Server.IntegrationTesting.IIS;
|
using Microsoft.AspNetCore.Server.IntegrationTesting.IIS;
|
||||||
using Microsoft.AspNetCore.Testing.xunit;
|
using Microsoft.AspNetCore.Testing.xunit;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
@ -40,13 +39,13 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
[SkipIfDebug]
|
[SkipIfDebug]
|
||||||
public async Task FrameworkNotFoundExceptionLogged_Pipe()
|
public async Task FrameworkNotFoundExceptionLogged_Pipe()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
InvalidateRuntimeConfig(deploymentResult);
|
InvalidateRuntimeConfig(deploymentResult);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
Assert.False(response.IsSuccessStatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
@ -60,7 +59,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
public async Task FrameworkNotFoundExceptionLogged_File()
|
public async Task FrameworkNotFoundExceptionLogged_File()
|
||||||
{
|
{
|
||||||
var deploymentParameters =
|
var deploymentParameters =
|
||||||
_fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
|
|
@ -68,7 +67,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
|
|
||||||
InvalidateRuntimeConfig(deploymentResult);
|
InvalidateRuntimeConfig(deploymentResult);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
Assert.False(response.IsSuccessStatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
@ -85,14 +84,16 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
public async Task EnableCoreHostTraceLogging_TwoLogFilesCreated()
|
public async Task EnableCoreHostTraceLogging_TwoLogFilesCreated()
|
||||||
{
|
{
|
||||||
var deploymentParameters =
|
var deploymentParameters =
|
||||||
_fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
deploymentParameters.TransformArguments((a, _) => $"{a} CheckLargeStdOutWrites");
|
||||||
|
|
||||||
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
||||||
|
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
Assert.False(response.IsSuccessStatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
@ -112,13 +113,13 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
[InlineData("CheckOversizedStdOutWrites")]
|
[InlineData("CheckOversizedStdOutWrites")]
|
||||||
public async Task EnableCoreHostTraceLogging_PipeCaptureNativeLogs(string path)
|
public async Task EnableCoreHostTraceLogging_PipeCaptureNativeLogs(string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_STARTUP_VALUE"] = path;
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
|
|
||||||
Assert.False(response.IsSuccessStatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
|
|
||||||
|
|
@ -137,15 +138,15 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
public async Task EnableCoreHostTraceLogging_FileCaptureNativeLogs(string path)
|
public async Task EnableCoreHostTraceLogging_FileCaptureNativeLogs(string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters =
|
var deploymentParameters =
|
||||||
_fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_STARTUP_VALUE"] = path;
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
||||||
|
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
Assert.False(response.IsSuccessStatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
@ -159,7 +160,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
|
|
||||||
private static void InvalidateRuntimeConfig(IISDeploymentResult deploymentResult)
|
private static void InvalidateRuntimeConfig(IISDeploymentResult deploymentResult)
|
||||||
{
|
{
|
||||||
var path = Path.Combine(deploymentResult.ContentRoot, "StartupExceptionWebSite.runtimeconfig.json");
|
var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json");
|
||||||
dynamic depsFileContent = JsonConvert.DeserializeObject(File.ReadAllText(path));
|
dynamic depsFileContent = JsonConvert.DeserializeObject(File.ReadAllText(path));
|
||||||
depsFileContent["runtimeOptions"]["framework"]["version"] = "2.9.9";
|
depsFileContent["runtimeOptions"]["framework"]["version"] = "2.9.9";
|
||||||
var output = JsonConvert.SerializeObject(depsFileContent);
|
var output = JsonConvert.SerializeObject(depsFileContent);
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,12 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task DetectsOveriddenServer()
|
public async Task DetectsOverriddenServer()
|
||||||
{
|
{
|
||||||
var deploymentResult = await DeployAsync(_fixture.GetBaseDeploymentParameters(_fixture.OverriddenServerWebSite, publish: true));
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
deploymentParameters.TransformArguments((a, _) => $"{a} OverriddenServer");
|
||||||
|
|
||||||
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/");
|
||||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||||
|
|
||||||
|
|
@ -149,7 +152,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task LogsStartupExceptionExitError()
|
public async Task LogsStartupExceptionExitError()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} Throw");
|
deploymentParameters.TransformArguments((a, _) => $"{a} Throw");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -167,9 +170,11 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task LogsUnexpectedThreadExitError()
|
public async Task LogsUnexpectedThreadExitError()
|
||||||
{
|
{
|
||||||
var deploymentResult = await DeployAsync(_fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true));
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
||||||
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
@ -182,7 +187,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task StartupTimeoutIsApplied()
|
public async Task StartupTimeoutIsApplied()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} Hang");
|
deploymentParameters.TransformArguments((a, _) => $"{a} Hang");
|
||||||
deploymentParameters.WebConfigActionList.Add(
|
deploymentParameters.WebConfigActionList.Add(
|
||||||
WebConfigHelpers.AddOrModifyAspNetCoreSection("startupTimeLimit", "1"));
|
WebConfigHelpers.AddOrModifyAspNetCoreSection("startupTimeLimit", "1"));
|
||||||
|
|
@ -202,14 +207,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task ShutdownTimeoutIsApplied()
|
public async Task ShutdownTimeoutIsApplied()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} HangOnStop");
|
deploymentParameters.TransformArguments((a, _) => $"{a} HangOnStop");
|
||||||
deploymentParameters.WebConfigActionList.Add(
|
deploymentParameters.WebConfigActionList.Add(
|
||||||
WebConfigHelpers.AddOrModifyAspNetCoreSection("shutdownTimeLimit", "1"));
|
WebConfigHelpers.AddOrModifyAspNetCoreSection("shutdownTimeLimit", "1"));
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
Assert.Equal("OK", await deploymentResult.HttpClient.GetStringAsync("/"));
|
Assert.Equal("Hello World", await deploymentResult.HttpClient.GetStringAsync("/HelloWorld"));
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,29 +4,11 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
using Microsoft.AspNetCore.Hosting.Server;
|
using Microsoft.AspNetCore.Hosting.Server;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
|
|
||||||
namespace IISTestSite
|
namespace TestSite
|
||||||
{
|
{
|
||||||
public static class Program
|
|
||||||
{
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
var host = new WebHostBuilder()
|
|
||||||
.UseIIS()
|
|
||||||
.ConfigureServices(services => services.AddSingleton<IServer, DummyServer>())
|
|
||||||
.Configure(builder => builder.Run(async context => { await context.Response.WriteAsync("I shouldn't work"); }))
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
host.Run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class DummyServer : IServer
|
public class DummyServer : IServer
|
||||||
{
|
{
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|
@ -2,15 +2,86 @@
|
||||||
// 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;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Hosting.Server;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace IISTestSite
|
namespace TestSite
|
||||||
{
|
{
|
||||||
public static class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static int Main(string[] args)
|
||||||
{
|
{
|
||||||
|
var mode = args.FirstOrDefault();
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
// Semicolons are appended to env variables; removing them.
|
||||||
|
case "CheckLargeStdOutWrites":
|
||||||
|
Console.WriteLine(new string('a', 30000));
|
||||||
|
break;
|
||||||
|
case "CheckLargeStdErrWrites":
|
||||||
|
Console.Error.WriteLine(new string('a', 30000));
|
||||||
|
Console.Error.Flush();
|
||||||
|
break;
|
||||||
|
case "ConsoleWrite":
|
||||||
|
Console.WriteLine($"Random number: {args[1]}");
|
||||||
|
break;
|
||||||
|
case "ConsoleErrorWrite":
|
||||||
|
Console.Error.WriteLine($"Random number: {args[1]}");
|
||||||
|
Console.Error.Flush();
|
||||||
|
break;
|
||||||
|
case "CheckOversizedStdErrWrites":
|
||||||
|
Console.WriteLine(new string('a', 31000));
|
||||||
|
break;
|
||||||
|
case "CheckOversizedStdOutWrites":
|
||||||
|
Console.Error.WriteLine(new string('a', 31000));
|
||||||
|
Console.Error.Flush();
|
||||||
|
break;
|
||||||
|
case "Hang":
|
||||||
|
Thread.Sleep(Timeout.Infinite);
|
||||||
|
break;
|
||||||
|
case "Throw":
|
||||||
|
throw new InvalidOperationException("Program.Main exception");
|
||||||
|
case "EarlyReturn":
|
||||||
|
return 12;
|
||||||
|
case "HangOnStop":
|
||||||
|
{
|
||||||
|
var host = new WebHostBuilder()
|
||||||
|
.UseIIS()
|
||||||
|
.UseStartup<Startup>()
|
||||||
|
.Build();
|
||||||
|
host.Run();
|
||||||
|
|
||||||
|
Thread.Sleep(Timeout.Infinite);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "CheckConsoleFunctions":
|
||||||
|
// Call a bunch of console functions and make sure none return invalid handle.
|
||||||
|
Console.OutputEncoding = Encoding.UTF8;
|
||||||
|
Console.Title = "Test";
|
||||||
|
Console.WriteLine($"Is Console redirection: {Console.IsOutputRedirected}");
|
||||||
|
Console.BackgroundColor = ConsoleColor.Blue;
|
||||||
|
Console.WriteLine("彡⾔");
|
||||||
|
break;
|
||||||
|
case "OverriddenServer":
|
||||||
|
{
|
||||||
|
var host = new WebHostBuilder()
|
||||||
|
.UseIIS()
|
||||||
|
.ConfigureServices(services => services.AddSingleton<IServer, DummyServer>())
|
||||||
|
.Configure(builder => builder.Run(async context => { await context.Response.WriteAsync("I shouldn't work"); }))
|
||||||
|
.Build();
|
||||||
|
host.Run();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
|
||||||
var envVariable = Environment.GetEnvironmentVariable("ASPNETCORE_INPROCESS_INITIAL_WRITE");
|
var envVariable = Environment.GetEnvironmentVariable("ASPNETCORE_INPROCESS_INITIAL_WRITE");
|
||||||
if (!string.IsNullOrEmpty(envVariable))
|
if (!string.IsNullOrEmpty(envVariable))
|
||||||
{
|
{
|
||||||
|
|
@ -29,6 +100,10 @@ namespace IISTestSite
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
host.Run();
|
host.Run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IISTestSite
|
namespace TestSite
|
||||||
{
|
{
|
||||||
public partial class Startup
|
public partial class Startup
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IISTestSite
|
namespace TestSite
|
||||||
{
|
{
|
||||||
public partial class Startup
|
public partial class Startup
|
||||||
{
|
{
|
||||||
|
|
@ -27,35 +27,18 @@ namespace IISTestSite
|
||||||
TestStartup.Register(app, this);
|
TestStartup.Register(app, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ServerVariable(IApplicationBuilder app)
|
private async Task ServerVariable(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
var varName = ctx.Request.Query["q"];
|
var varName = ctx.Request.Query["q"];
|
||||||
await ctx.Response.WriteAsync($"{varName}: {ctx.GetIISServerVariable(varName) ?? "(null)"}");
|
await ctx.Response.WriteAsync($"{varName}: {ctx.GetIISServerVariable(varName) ?? "(null)"}");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AuthenticationAnonymous(IApplicationBuilder app)
|
private async Task AuthenticationAnonymous(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
await ctx.Response.WriteAsync("Anonymous?" + !ctx.User.Identity.IsAuthenticated);
|
await ctx.Response.WriteAsync("Anonymous?" + !ctx.User.Identity.IsAuthenticated);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HostingEnvironment(HttpContext context)
|
private async Task AuthenticationRestricted(HttpContext ctx)
|
||||||
{
|
|
||||||
var hostingEnv = context.RequestServices.GetService<IHostingEnvironment>();
|
|
||||||
|
|
||||||
await context.Response.WriteAsync("ContentRootPath "+hostingEnv.ContentRootPath + Environment.NewLine);
|
|
||||||
await context.Response.WriteAsync("WebRootPath "+hostingEnv.WebRootPath + Environment.NewLine);
|
|
||||||
await context.Response.WriteAsync("CurrentDirectory "+Environment.CurrentDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AuthenticationRestricted(IApplicationBuilder app)
|
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
if (ctx.User.Identity.IsAuthenticated)
|
if (ctx.User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
|
|
@ -65,20 +48,14 @@ namespace IISTestSite
|
||||||
{
|
{
|
||||||
await ctx.ChallengeAsync(IISServerDefaults.AuthenticationScheme);
|
await ctx.ChallengeAsync(IISServerDefaults.AuthenticationScheme);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AuthenticationForbidden(IApplicationBuilder app)
|
private async Task AuthenticationForbidden(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
await ctx.ForbidAsync(IISServerDefaults.AuthenticationScheme);
|
await ctx.ForbidAsync(IISServerDefaults.AuthenticationScheme);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AuthenticationRestrictedNTLM(IApplicationBuilder app)
|
private async Task AuthenticationRestrictedNTLM(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
if (string.Equals("NTLM", ctx.User.Identity.AuthenticationType, StringComparison.Ordinal))
|
if (string.Equals("NTLM", ctx.User.Identity.AuthenticationType, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
|
|
@ -88,139 +65,128 @@ namespace IISTestSite
|
||||||
{
|
{
|
||||||
await ctx.ChallengeAsync(IISServerDefaults.AuthenticationScheme);
|
await ctx.ChallengeAsync(IISServerDefaults.AuthenticationScheme);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FeatureCollectionSetRequestFeatures(IApplicationBuilder app)
|
private async Task FeatureCollectionSetRequestFeatures(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Assert.Equal("GET", context.Request.Method);
|
Assert.Equal("GET", ctx.Request.Method);
|
||||||
context.Request.Method = "test";
|
ctx.Request.Method = "test";
|
||||||
Assert.Equal("test", context.Request.Method);
|
Assert.Equal("test", ctx.Request.Method);
|
||||||
|
|
||||||
Assert.Equal("http", context.Request.Scheme);
|
Assert.Equal("http", ctx.Request.Scheme);
|
||||||
context.Request.Scheme = "test";
|
ctx.Request.Scheme = "test";
|
||||||
Assert.Equal("test", context.Request.Scheme);
|
Assert.Equal("test", ctx.Request.Scheme);
|
||||||
|
|
||||||
Assert.Equal("/FeatureCollectionSetRequestFeatures", context.Request.PathBase);
|
Assert.Equal("/FeatureCollectionSetRequestFeatures", ctx.Request.PathBase);
|
||||||
context.Request.PathBase = "/base";
|
ctx.Request.PathBase = "/base";
|
||||||
Assert.Equal("/base", context.Request.PathBase);
|
Assert.Equal("/base", ctx.Request.PathBase);
|
||||||
|
|
||||||
Assert.Equal("/path", context.Request.Path);
|
Assert.Equal("/path", ctx.Request.Path);
|
||||||
context.Request.Path = "/path";
|
ctx.Request.Path = "/path";
|
||||||
Assert.Equal("/path", context.Request.Path);
|
Assert.Equal("/path", ctx.Request.Path);
|
||||||
|
|
||||||
Assert.Equal("?query", context.Request.QueryString.Value);
|
Assert.Equal("?query", ctx.Request.QueryString.Value);
|
||||||
context.Request.QueryString = QueryString.Empty;
|
ctx.Request.QueryString = QueryString.Empty;
|
||||||
Assert.Equal("", context.Request.QueryString.Value);
|
Assert.Equal("", ctx.Request.QueryString.Value);
|
||||||
|
|
||||||
Assert.Equal("HTTP/1.1", context.Request.Protocol);
|
Assert.Equal("HTTP/1.1", ctx.Request.Protocol);
|
||||||
context.Request.Protocol = "HTTP/1.0";
|
ctx.Request.Protocol = "HTTP/1.0";
|
||||||
Assert.Equal("HTTP/1.0", context.Request.Protocol);
|
Assert.Equal("HTTP/1.0", ctx.Request.Protocol);
|
||||||
|
|
||||||
Assert.NotNull(context.Request.Headers);
|
Assert.NotNull(ctx.Request.Headers);
|
||||||
var headers = new HeaderDictionary();
|
var headers = new HeaderDictionary();
|
||||||
context.Features.Get<IHttpRequestFeature>().Headers = headers;
|
ctx.Features.Get<IHttpRequestFeature>().Headers = headers;
|
||||||
Assert.Same(headers, context.Features.Get<IHttpRequestFeature>().Headers);
|
Assert.Same(headers, ctx.Features.Get<IHttpRequestFeature>().Headers);
|
||||||
|
|
||||||
Assert.NotNull(context.Request.Body);
|
Assert.NotNull(ctx.Request.Body);
|
||||||
var body = new MemoryStream();
|
var body = new MemoryStream();
|
||||||
context.Request.Body = body;
|
ctx.Request.Body = body;
|
||||||
Assert.Same(body, context.Request.Body);
|
Assert.Same(body, ctx.Request.Body);
|
||||||
|
|
||||||
//Assert.NotNull(context.Features.Get<IHttpRequestIdentifierFeature>().TraceIdentifier);
|
//Assert.NotNull(ctx.Features.Get<IHttpRequestIdentifierFeature>().TraceIdentifier);
|
||||||
//Assert.NotEqual(CancellationToken.None, context.RequestAborted);
|
//Assert.NotEqual(CancellationToken.None, ctx.RequestAborted);
|
||||||
//var token = new CancellationTokenSource().Token;
|
//var token = new CancellationTokenSource().Token;
|
||||||
//context.RequestAborted = token;
|
//ctx.RequestAborted = token;
|
||||||
//Assert.Equal(token, context.RequestAborted);
|
//Assert.Equal(token, ctx.RequestAborted);
|
||||||
|
|
||||||
await context.Response.WriteAsync("Success");
|
await ctx.Response.WriteAsync("Success");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 500;
|
ctx.Response.StatusCode = 500;
|
||||||
await context.Response.WriteAsync(exception.ToString());
|
await ctx.Response.WriteAsync(exception.ToString());
|
||||||
}
|
}
|
||||||
await context.Response.WriteAsync("_Failure");
|
await ctx.Response.WriteAsync("_Failure");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FeatureCollectionSetResponseFeatures(IApplicationBuilder app)
|
private async Task FeatureCollectionSetResponseFeatures(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Assert.Equal(200, context.Response.StatusCode);
|
Assert.Equal(200, ctx.Response.StatusCode);
|
||||||
context.Response.StatusCode = 404;
|
ctx.Response.StatusCode = 404;
|
||||||
Assert.Equal(404, context.Response.StatusCode);
|
Assert.Equal(404, ctx.Response.StatusCode);
|
||||||
context.Response.StatusCode = 200;
|
ctx.Response.StatusCode = 200;
|
||||||
|
|
||||||
Assert.Null(context.Features.Get<IHttpResponseFeature>().ReasonPhrase);
|
Assert.Null(ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase);
|
||||||
context.Features.Get<IHttpResponseFeature>().ReasonPhrase = "Set Response";
|
ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase = "Set Response";
|
||||||
Assert.Equal("Set Response", context.Features.Get<IHttpResponseFeature>().ReasonPhrase);
|
Assert.Equal("Set Response", ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase);
|
||||||
|
|
||||||
Assert.NotNull(context.Response.Headers);
|
Assert.NotNull(ctx.Response.Headers);
|
||||||
var headers = new HeaderDictionary();
|
var headers = new HeaderDictionary();
|
||||||
context.Features.Get<IHttpResponseFeature>().Headers = headers;
|
ctx.Features.Get<IHttpResponseFeature>().Headers = headers;
|
||||||
Assert.Same(headers, context.Features.Get<IHttpResponseFeature>().Headers);
|
Assert.Same(headers, ctx.Features.Get<IHttpResponseFeature>().Headers);
|
||||||
|
|
||||||
var originalBody = context.Response.Body;
|
var originalBody = ctx.Response.Body;
|
||||||
Assert.NotNull(originalBody);
|
Assert.NotNull(originalBody);
|
||||||
var body = new MemoryStream();
|
var body = new MemoryStream();
|
||||||
context.Response.Body = body;
|
ctx.Response.Body = body;
|
||||||
Assert.Same(body, context.Response.Body);
|
Assert.Same(body, ctx.Response.Body);
|
||||||
context.Response.Body = originalBody;
|
ctx.Response.Body = originalBody;
|
||||||
|
|
||||||
await context.Response.WriteAsync("Success");
|
await ctx.Response.WriteAsync("Success");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 500;
|
ctx.Response.StatusCode = 500;
|
||||||
await context.Response.WriteAsync(exception.ToString());
|
await ctx.Response.WriteAsync(exception.ToString());
|
||||||
}
|
}
|
||||||
await context.Response.WriteAsync("_Failure");
|
await ctx.Response.WriteAsync("_Failure");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FeatureCollectionSetConnectionFeatures(IApplicationBuilder app)
|
private async Task FeatureCollectionSetConnectionFeatures(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Assert.True(IPAddress.IsLoopback(context.Connection.LocalIpAddress));
|
Assert.True(IPAddress.IsLoopback(ctx.Connection.LocalIpAddress));
|
||||||
context.Connection.LocalIpAddress = IPAddress.IPv6Any;
|
ctx.Connection.LocalIpAddress = IPAddress.IPv6Any;
|
||||||
Assert.Equal(IPAddress.IPv6Any, context.Connection.LocalIpAddress);
|
Assert.Equal(IPAddress.IPv6Any, ctx.Connection.LocalIpAddress);
|
||||||
|
|
||||||
Assert.True(IPAddress.IsLoopback(context.Connection.RemoteIpAddress));
|
Assert.True(IPAddress.IsLoopback(ctx.Connection.RemoteIpAddress));
|
||||||
context.Connection.RemoteIpAddress = IPAddress.IPv6Any;
|
ctx.Connection.RemoteIpAddress = IPAddress.IPv6Any;
|
||||||
Assert.Equal(IPAddress.IPv6Any, context.Connection.RemoteIpAddress);
|
Assert.Equal(IPAddress.IPv6Any, ctx.Connection.RemoteIpAddress);
|
||||||
await context.Response.WriteAsync("Success");
|
await ctx.Response.WriteAsync("Success");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 500;
|
ctx.Response.StatusCode = 500;
|
||||||
await context.Response.WriteAsync(exception.ToString());
|
await ctx.Response.WriteAsync(exception.ToString());
|
||||||
}
|
}
|
||||||
await context.Response.WriteAsync("_Failure");
|
await ctx.Response.WriteAsync("_Failure");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Throw(IApplicationBuilder app)
|
private void Throw(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(ctx => { throw new Exception(); });
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetCustomErorCode(IApplicationBuilder app)
|
private async Task SetCustomErorCode(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async ctx => {
|
|
||||||
var feature = ctx.Features.Get<IHttpResponseFeature>();
|
var feature = ctx.Features.Get<IHttpResponseFeature>();
|
||||||
feature.ReasonPhrase = ctx.Request.Query["reason"];
|
feature.ReasonPhrase = ctx.Request.Query["reason"];
|
||||||
feature.StatusCode = int.Parse(ctx.Request.Query["code"]);
|
feature.StatusCode = int.Parse(ctx.Request.Query["code"]);
|
||||||
|
|
@ -228,12 +194,9 @@ namespace IISTestSite
|
||||||
{
|
{
|
||||||
await ctx.Response.WriteAsync(ctx.Request.Query["body"]);
|
await ctx.Response.WriteAsync(ctx.Request.Query["body"]);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HelloWorld(IApplicationBuilder app)
|
private async Task HelloWorld(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
if (ctx.Request.Path.Value.StartsWith("/Path"))
|
if (ctx.Request.Path.Value.StartsWith("/Path"))
|
||||||
{
|
{
|
||||||
|
|
@ -247,149 +210,121 @@ namespace IISTestSite
|
||||||
}
|
}
|
||||||
|
|
||||||
await ctx.Response.WriteAsync("Hello World");
|
await ctx.Response.WriteAsync("Hello World");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LargeResponseBody(IApplicationBuilder app)
|
private async Task LargeResponseBody(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
if (int.TryParse(ctx.Request.Query["length"], out var length))
|
||||||
{
|
{
|
||||||
if (int.TryParse(context.Request.Query["length"], out var length))
|
await ctx.Response.WriteAsync(new string('a', length));
|
||||||
{
|
|
||||||
await context.Response.WriteAsync(new string('a', length));
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResponseHeaders(IApplicationBuilder app)
|
private async Task ResponseHeaders(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
ctx.Response.Headers["UnknownHeader"] = "test123=foo";
|
||||||
{
|
ctx.Response.ContentType = "text/plain";
|
||||||
context.Response.Headers["UnknownHeader"] = "test123=foo";
|
ctx.Response.Headers["MultiHeader"] = new StringValues(new string[] { "1", "2" });
|
||||||
context.Response.ContentType = "text/plain";
|
await ctx.Response.WriteAsync("Request Complete");
|
||||||
context.Response.Headers["MultiHeader"] = new StringValues(new string[] { "1", "2" });
|
|
||||||
await context.Response.WriteAsync("Request Complete");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResponseInvalidOrdering(IApplicationBuilder app)
|
private async Task ResponseInvalidOrdering(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
if (ctx.Request.Path.Equals("/SetStatusCodeAfterWrite"))
|
||||||
{
|
{
|
||||||
if (context.Request.Path.Equals("/SetStatusCodeAfterWrite"))
|
await ctx.Response.WriteAsync("Started_");
|
||||||
{
|
|
||||||
await context.Response.WriteAsync("Started_");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 200;
|
ctx.Response.StatusCode = 200;
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync("SetStatusCodeAfterWriteThrew_");
|
await ctx.Response.WriteAsync("SetStatusCodeAfterWriteThrew_");
|
||||||
}
|
}
|
||||||
await context.Response.WriteAsync("Finished");
|
await ctx.Response.WriteAsync("Finished");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.Equals("/SetHeaderAfterWrite"))
|
else if (ctx.Request.Path.Equals("/SetHeaderAfterWrite"))
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync("Started_");
|
await ctx.Response.WriteAsync("Started_");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
context.Response.Headers["This will fail"] = "some value";
|
ctx.Response.Headers["This will fail"] = "some value";
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync("SetHeaderAfterWriteThrew_");
|
await ctx.Response.WriteAsync("SetHeaderAfterWriteThrew_");
|
||||||
}
|
}
|
||||||
await context.Response.WriteAsync("Finished");
|
await ctx.Response.WriteAsync("Finished");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckEnvironmentVariable(IApplicationBuilder app)
|
private async Task CheckEnvironmentVariable(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var variable = Environment.GetEnvironmentVariable("ASPNETCORE_INPROCESS_TESTING_VALUE");
|
var variable = Environment.GetEnvironmentVariable("ASPNETCORE_INPROCESS_TESTING_VALUE");
|
||||||
await context.Response.WriteAsync(variable);
|
await ctx.Response.WriteAsync(variable);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckEnvironmentLongValueVariable(IApplicationBuilder app)
|
private async Task CheckEnvironmentLongValueVariable(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var variable = Environment.GetEnvironmentVariable("ASPNETCORE_INPROCESS_TESTING_LONG_VALUE");
|
var variable = Environment.GetEnvironmentVariable("ASPNETCORE_INPROCESS_TESTING_LONG_VALUE");
|
||||||
await context.Response.WriteAsync(variable);
|
await ctx.Response.WriteAsync(variable);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckAppendedEnvironmentVariable(IApplicationBuilder app)
|
private async Task CheckAppendedEnvironmentVariable(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var variable = Environment.GetEnvironmentVariable("ProgramFiles");
|
var variable = Environment.GetEnvironmentVariable("ProgramFiles");
|
||||||
await context.Response.WriteAsync(variable);
|
await ctx.Response.WriteAsync(variable);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckRemoveAuthEnvironmentVariable(IApplicationBuilder app)
|
private async Task CheckRemoveAuthEnvironmentVariable(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var variable = Environment.GetEnvironmentVariable("ASPNETCORE_IIS_HTTPAUTH");
|
var variable = Environment.GetEnvironmentVariable("ASPNETCORE_IIS_HTTPAUTH");
|
||||||
await context.Response.WriteAsync(variable);
|
await ctx.Response.WriteAsync(variable);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
private void ReadAndWriteSynchronously(IApplicationBuilder app)
|
private async Task ReadAndWriteSynchronously(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
var t2 = Task.Run(() => WriteManyTimesToResponseBody(ctx));
|
||||||
{
|
var t1 = Task.Run(() => ReadRequestBody(ctx));
|
||||||
var t2 = Task.Run(() => WriteManyTimesToResponseBody(context));
|
|
||||||
var t1 = Task.Run(() => ReadRequestBody(context));
|
|
||||||
await Task.WhenAll(t1, t2);
|
await Task.WhenAll(t1, t2);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ReadRequestBody(HttpContext context)
|
private async Task ReadRequestBody(HttpContext ctx)
|
||||||
{
|
{
|
||||||
var readBuffer = new byte[1];
|
var readBuffer = new byte[1];
|
||||||
var result = await context.Request.Body.ReadAsync(readBuffer, 0, 1);
|
var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, 1);
|
||||||
while (result != 0)
|
while (result != 0)
|
||||||
{
|
{
|
||||||
result = await context.Request.Body.ReadAsync(readBuffer, 0, 1);
|
result = await ctx.Request.Body.ReadAsync(readBuffer, 0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task WriteManyTimesToResponseBody(HttpContext context)
|
private async Task WriteManyTimesToResponseBody(HttpContext ctx)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < 10000; i++)
|
for (var i = 0; i < 10000; i++)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync("hello world");
|
await ctx.Response.WriteAsync("hello world");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadAndWriteEcho(IApplicationBuilder app)
|
private async Task ReadAndWriteEcho(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context => {
|
|
||||||
var readBuffer = new byte[4096];
|
var readBuffer = new byte[4096];
|
||||||
var result = await context.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
||||||
while (result != 0)
|
while (result != 0)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
|
await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
|
||||||
result = await context.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadAndWriteEchoLines(IApplicationBuilder app)
|
private async Task ReadAndWriteEchoLines(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context => {
|
|
||||||
//Send headers
|
//Send headers
|
||||||
await context.Response.Body.FlushAsync();
|
await ctx.Response.Body.FlushAsync();
|
||||||
|
|
||||||
var reader = new StreamReader(context.Request.Body);
|
var reader = new StreamReader(ctx.Request.Body);
|
||||||
while (!reader.EndOfStream)
|
while (!reader.EndOfStream)
|
||||||
{
|
{
|
||||||
var line = await reader.ReadLineAsync();
|
var line = await reader.ReadLineAsync();
|
||||||
|
|
@ -397,83 +332,67 @@ namespace IISTestSite
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await context.Response.WriteAsync(line + Environment.NewLine);
|
await ctx.Response.WriteAsync(line + Environment.NewLine);
|
||||||
await context.Response.Body.FlushAsync();
|
await ctx.Response.Body.FlushAsync();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadPartialBody(IApplicationBuilder app)
|
private async Task ReadPartialBody(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context => {
|
|
||||||
var data = new byte[5];
|
var data = new byte[5];
|
||||||
var count = 0;
|
var count = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
count += await context.Request.Body.ReadAsync(data, count, data.Length - count);
|
count += await ctx.Request.Body.ReadAsync(data, count, data.Length - count);
|
||||||
} while (count != data.Length);
|
} while (count != data.Length);
|
||||||
await context.Response.Body.WriteAsync(data, 0, data.Length);
|
await ctx.Response.Body.WriteAsync(data, 0, data.Length);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetHeaderFromBody(IApplicationBuilder app)
|
private async Task SetHeaderFromBody(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context => {
|
using (var reader = new StreamReader(ctx.Request.Body))
|
||||||
using (var reader = new StreamReader(context.Request.Body))
|
|
||||||
{
|
{
|
||||||
var value = await reader.ReadToEndAsync();
|
var value = await reader.ReadToEndAsync();
|
||||||
context.Response.Headers["BodyAsString"] = value;
|
ctx.Response.Headers["BodyAsString"] = value;
|
||||||
await context.Response.WriteAsync(value);
|
await ctx.Response.WriteAsync(value);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadAndWriteEchoTwice(IApplicationBuilder app)
|
private async Task ReadAndWriteEchoTwice(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var readBuffer = new byte[4096];
|
var readBuffer = new byte[4096];
|
||||||
var result = await context.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
||||||
while (result != 0)
|
while (result != 0)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
|
await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
|
||||||
await context.Response.Body.FlushAsync();
|
await ctx.Response.Body.FlushAsync();
|
||||||
await context.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
|
await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result));
|
||||||
await context.Response.Body.FlushAsync();
|
await ctx.Response.Body.FlushAsync();
|
||||||
result = await context.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadAndWriteSlowConnection(IApplicationBuilder app)
|
private async Task ReadAndWriteSlowConnection(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
var t2 = Task.Run(() => WriteResponseBodyAFewTimes(ctx));
|
||||||
{
|
var t1 = Task.Run(() => ReadRequestBody(ctx));
|
||||||
var t2 = Task.Run(() => WriteResponseBodyAFewTimes(context));
|
|
||||||
var t1 = Task.Run(() => ReadRequestBody(context));
|
|
||||||
await Task.WhenAll(t1, t2);
|
await Task.WhenAll(t1, t2);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task WriteResponseBodyAFewTimes(HttpContext context)
|
private async Task WriteResponseBodyAFewTimes(HttpContext ctx)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < 100; i++)
|
for (var i = 0; i < 100; i++)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync("hello world");
|
await ctx.Response.WriteAsync("hello world");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadAndWriteCopyToAsync(IApplicationBuilder app)
|
private async Task ReadAndWriteCopyToAsync(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
await ctx.Request.Body.CopyToAsync(ctx.Response.Body);
|
||||||
{
|
|
||||||
await context.Request.Body.CopyToAsync(context.Response.Body);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpgradeFeatureDetection(IApplicationBuilder app)
|
private async Task UpgradeFeatureDetection(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
if (ctx.Features.Get<IHttpUpgradeFeature>() != null)
|
if (ctx.Features.Get<IHttpUpgradeFeature>() != null)
|
||||||
{
|
{
|
||||||
|
|
@ -483,86 +402,80 @@ namespace IISTestSite
|
||||||
{
|
{
|
||||||
await ctx.Response.WriteAsync("Disabled");
|
await ctx.Response.WriteAsync("Disabled");
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TestReadOffsetWorks(IApplicationBuilder app)
|
private async Task TestReadOffsetWorks(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
var buffer = new byte[11];
|
var buffer = new byte[11];
|
||||||
ctx.Request.Body.Read(buffer, 0, 6);
|
ctx.Request.Body.Read(buffer, 0, 6);
|
||||||
ctx.Request.Body.Read(buffer, 6, 5);
|
ctx.Request.Body.Read(buffer, 6, 5);
|
||||||
|
|
||||||
await ctx.Response.WriteAsync(Encoding.UTF8.GetString(buffer));
|
await ctx.Response.WriteAsync(Encoding.UTF8.GetString(buffer));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TestInvalidReadOperations(IApplicationBuilder app)
|
private async Task TestInvalidReadOperations(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var success = false;
|
var success = false;
|
||||||
if (context.Request.Path.StartsWithSegments("/NullBuffer"))
|
if (ctx.Request.Path.StartsWithSegments("/NullBuffer"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Request.Body.ReadAsync(null, 0, 0);
|
await ctx.Request.Body.ReadAsync(null, 0, 0);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidOffsetSmall"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidOffsetSmall"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Request.Body.ReadAsync(new byte[1], -1, 0);
|
await ctx.Request.Body.ReadAsync(new byte[1], -1, 0);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidOffsetLarge"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidOffsetLarge"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Request.Body.ReadAsync(new byte[1], 2, 0);
|
await ctx.Request.Body.ReadAsync(new byte[1], 2, 0);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountSmall"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountSmall"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Request.Body.ReadAsync(new byte[1], 0, -1);
|
await ctx.Request.Body.ReadAsync(new byte[1], 0, -1);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountLarge"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountLarge"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Request.Body.ReadAsync(new byte[1], 0, -1);
|
await ctx.Request.Body.ReadAsync(new byte[1], 0, -1);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountWithOffset"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountWithOffset"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Request.Body.ReadAsync(new byte[3], 1, 3);
|
await ctx.Request.Body.ReadAsync(new byte[3], 1, 3);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
|
|
@ -571,92 +484,86 @@ namespace IISTestSite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
await context.Response.WriteAsync(success ? "Success" : "Failure");
|
await ctx.Response.WriteAsync(success ? "Success" : "Failure");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TestValidReadOperations(IApplicationBuilder app)
|
private async Task TestValidReadOperations(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var count = -1;
|
var count = -1;
|
||||||
|
|
||||||
if (context.Request.Path.StartsWithSegments("/NullBuffer"))
|
if (ctx.Request.Path.StartsWithSegments("/NullBuffer"))
|
||||||
{
|
{
|
||||||
count = await context.Request.Body.ReadAsync(null, 0, 0);
|
count = await ctx.Request.Body.ReadAsync(null, 0, 0);
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/NullBufferPost"))
|
else if (ctx.Request.Path.StartsWithSegments("/NullBufferPost"))
|
||||||
{
|
{
|
||||||
count = await context.Request.Body.ReadAsync(null, 0, 0);
|
count = await ctx.Request.Body.ReadAsync(null, 0, 0);
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountZeroRead"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountZeroRead"))
|
||||||
{
|
{
|
||||||
count = await context.Request.Body.ReadAsync(new byte[1], 0, 0);
|
count = await ctx.Request.Body.ReadAsync(new byte[1], 0, 0);
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountZeroReadPost"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountZeroReadPost"))
|
||||||
{
|
{
|
||||||
count = await context.Request.Body.ReadAsync(new byte[1], 0, 0);
|
count = await ctx.Request.Body.ReadAsync(new byte[1], 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
await context.Response.WriteAsync(count == 0 ? "Success" : "Failure");
|
await ctx.Response.WriteAsync(count == 0 ? "Success" : "Failure");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TestInvalidWriteOperations(IApplicationBuilder app)
|
private async Task TestInvalidWriteOperations(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async context =>
|
|
||||||
{
|
{
|
||||||
var success = false;
|
var success = false;
|
||||||
|
|
||||||
if (context.Request.Path.StartsWithSegments("/InvalidOffsetSmall"))
|
if (ctx.Request.Path.StartsWithSegments("/InvalidOffsetSmall"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Response.Body.WriteAsync(new byte[1], -1, 0);
|
await ctx.Response.Body.WriteAsync(new byte[1], -1, 0);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidOffsetLarge"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidOffsetLarge"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Response.Body.WriteAsync(new byte[1], 2, 0);
|
await ctx.Response.Body.WriteAsync(new byte[1], 2, 0);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountSmall"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountSmall"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Response.Body.WriteAsync(new byte[1], 0, -1);
|
await ctx.Response.Body.WriteAsync(new byte[1], 0, -1);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountLarge"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountLarge"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Response.Body.WriteAsync(new byte[1], 0, -1);
|
await ctx.Response.Body.WriteAsync(new byte[1], 0, -1);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/InvalidCountWithOffset"))
|
else if (ctx.Request.Path.StartsWithSegments("/InvalidCountWithOffset"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await context.Response.Body.WriteAsync(new byte[3], 1, 3);
|
await ctx.Response.Body.WriteAsync(new byte[3], 1, 3);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
|
|
@ -664,30 +571,24 @@ namespace IISTestSite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await context.Response.WriteAsync(success ? "Success" : "Failure");
|
await ctx.Response.WriteAsync(success ? "Success" : "Failure");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TestValidWriteOperations(IApplicationBuilder app)
|
private async Task TestValidWriteOperations(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
if (ctx.Request.Path.StartsWithSegments("/NullBuffer"))
|
||||||
{
|
{
|
||||||
if (context.Request.Path.StartsWithSegments("/NullBuffer"))
|
await ctx.Response.Body.WriteAsync(null, 0, 0);
|
||||||
{
|
|
||||||
await context.Response.Body.WriteAsync(null, 0, 0);
|
|
||||||
}
|
}
|
||||||
else if (context.Request.Path.StartsWithSegments("/NullBufferPost"))
|
else if (ctx.Request.Path.StartsWithSegments("/NullBufferPost"))
|
||||||
{
|
{
|
||||||
await context.Response.Body.WriteAsync(null, 0, 0);
|
await ctx.Response.Body.WriteAsync(null, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
await context.Response.WriteAsync("Success");
|
await ctx.Response.WriteAsync("Success");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LargeResponseFile(IApplicationBuilder app)
|
private async Task LargeResponseFile(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
var tempFile = Path.GetTempFileName();
|
var tempFile = Path.GetTempFileName();
|
||||||
var fileContent = new string('a', 200000);
|
var fileContent = new string('a', 200000);
|
||||||
|
|
@ -711,62 +612,37 @@ namespace IISTestSite
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BasePath(IApplicationBuilder app)
|
private async Task BasePath(HttpContext ctx)
|
||||||
{
|
{
|
||||||
app.Run(async ctx => { await ctx.Response.WriteAsync(AppDomain.CurrentDomain.BaseDirectory); });
|
await ctx.Response.WriteAsync(AppDomain.CurrentDomain.BaseDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckLogFile(IApplicationBuilder app)
|
private async Task Shutdown(HttpContext ctx)
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
|
||||||
Console.WriteLine("TEST MESSAGE");
|
|
||||||
|
|
||||||
await ctx.Response.WriteAsync("Hello World");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckErrLogFile(IApplicationBuilder app)
|
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
|
||||||
Console.Error.WriteLine("TEST MESSAGE");
|
|
||||||
Console.Error.Flush();
|
|
||||||
|
|
||||||
await ctx.Response.WriteAsync("Hello World");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Shutdown(IApplicationBuilder app)
|
|
||||||
{
|
|
||||||
app.Run(async ctx =>
|
|
||||||
{
|
{
|
||||||
await ctx.Response.WriteAsync("Shutting down");
|
await ctx.Response.WriteAsync("Shutting down");
|
||||||
ctx.RequestServices.GetService<IApplicationLifetime>().StopApplication();
|
ctx.RequestServices.GetService<IApplicationLifetime>().StopApplication();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task GetServerVariableStress(HttpContext context)
|
private async Task GetServerVariableStress(HttpContext ctx)
|
||||||
{
|
{
|
||||||
// This test simulates the scenario where native Flush call is being
|
// This test simulates the scenario where native Flush call is being
|
||||||
// executed on background thread while request thread calls GetServerVariable
|
// executed on background thread while request thread calls GetServerVariable
|
||||||
// concurrent native calls may cause native object corruption
|
// concurrent native calls may cause native object corruption
|
||||||
|
|
||||||
await context.Response.WriteAsync("Response Begin");
|
await ctx.Response.WriteAsync("Response Begin");
|
||||||
for (int i = 0; i < 1000; i++)
|
for (int i = 0; i < 1000; i++)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync(context.GetIISServerVariable("REMOTE_PORT"));
|
await ctx.Response.WriteAsync(ctx.GetIISServerVariable("REMOTE_PORT"));
|
||||||
await context.Response.Body.FlushAsync();
|
await ctx.Response.Body.FlushAsync();
|
||||||
}
|
}
|
||||||
await context.Response.WriteAsync("Response End");
|
await ctx.Response.WriteAsync("Response End");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task CommandLineArgs(HttpContext context)
|
private async Task CommandLineArgs(HttpContext ctx)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync(string.Join("|", Environment.GetCommandLineArgs().Skip(1)));
|
await ctx.Response.WriteAsync(string.Join("|", Environment.GetCommandLineArgs().Skip(1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System.IO;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace TestSites
|
namespace TestSite
|
||||||
{
|
{
|
||||||
public static class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,10 @@ using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
using Microsoft.AspNetCore.Hosting.Server.Features;
|
using Microsoft.AspNetCore.Hosting.Server.Features;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
|
|
@ -19,9 +17,9 @@ using Microsoft.AspNetCore.Server.IISIntegration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace TestSites
|
namespace TestSite
|
||||||
{
|
{
|
||||||
public class Startup
|
public partial class Startup
|
||||||
{
|
{
|
||||||
private IServerAddressesFeature _serverAddresses;
|
private IServerAddressesFeature _serverAddresses;
|
||||||
|
|
||||||
|
|
@ -112,15 +110,6 @@ namespace TestSites
|
||||||
return context.Response.WriteAsync(context.Request.Headers["ANCMRHPath"]);
|
return context.Response.WriteAsync(context.Request.Headers["ANCMRHPath"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HostingEnvironment(HttpContext context)
|
|
||||||
{
|
|
||||||
var hostingEnv = context.RequestServices.GetService<IHostingEnvironment>();
|
|
||||||
|
|
||||||
await context.Response.WriteAsync("ContentRootPath "+hostingEnv.ContentRootPath + Environment.NewLine);
|
|
||||||
await context.Response.WriteAsync("WebRootPath "+hostingEnv.WebRootPath + Environment.NewLine);
|
|
||||||
await context.Response.WriteAsync("CurrentDirectory "+Environment.CurrentDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task ProcessId(HttpContext context)
|
private async Task ProcessId(HttpContext context)
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync(Process.GetCurrentProcess().Id.ToString());
|
await context.Response.WriteAsync(Process.GetCurrentProcess().Id.ToString());
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
|
|
||||||
<InProcessTestSite>true</InProcessTestSite>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\testsite.props" />
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Server.IIS\Microsoft.AspNetCore.Server.IIS.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
{
|
|
||||||
"iisSettings": {
|
|
||||||
"windowsAuthentication": true,
|
|
||||||
"anonymousAuthentication": true,
|
|
||||||
"iisExpress": {
|
|
||||||
"applicationUrl": "http://localhost:5762/",
|
|
||||||
"sslPort": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"profiles": {
|
|
||||||
"ANCM IIS Express": {
|
|
||||||
"commandName": "Executable",
|
|
||||||
"executablePath": "$(IISExpressPath)",
|
|
||||||
"commandLineArgs": "$(IISExpressArguments)",
|
|
||||||
"nativeDebugging": true,
|
|
||||||
"environmentVariables": {
|
|
||||||
"IIS_SITE_PATH": "$(MSBuildThisFileDirectory)",
|
|
||||||
"ANCM_PATH": "$(TargetDir)\\$(AncmPath)",
|
|
||||||
"ANCMV2_PATH": "$(TargetDir)\\$(AncmV2Path)",
|
|
||||||
"LAUNCHER_ARGS": "$(TargetPath)",
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
|
||||||
"LAUNCHER_PATH": "$(DotNetPath)",
|
|
||||||
"ASPNETCORE_MODULE_DEBUG": "console"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ANCM IIS": {
|
|
||||||
"commandName": "Executable",
|
|
||||||
"executablePath": "$(IISPath)",
|
|
||||||
"commandLineArgs": "$(IISArguments)",
|
|
||||||
"environmentVariables": {
|
|
||||||
"IIS_SITE_PATH": "$(MSBuildThisFileDirectory)",
|
|
||||||
"ANCM_PATH": "$(AncmPath)",
|
|
||||||
"ANCMV2_PATH": "$(AncmV2Path)",
|
|
||||||
"LAUNCHER_ARGS": "$(TargetPath)",
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
|
||||||
"LAUNCHER_PATH": "$(DotNetPath)",
|
|
||||||
"ASPNETCORE_MODULE_DEBUG": "console"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
// 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.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
|
|
||||||
namespace IISTestSite
|
|
||||||
{
|
|
||||||
public static class Program
|
|
||||||
{
|
|
||||||
public static int Main(string[] args)
|
|
||||||
{
|
|
||||||
var mode = args.FirstOrDefault();
|
|
||||||
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
// Semicolons are appended to env variables; removing them.
|
|
||||||
case "CheckLargeStdOutWrites":
|
|
||||||
Console.WriteLine(new string('a', 30000));
|
|
||||||
break;
|
|
||||||
case "CheckLargeStdErrWrites":
|
|
||||||
Console.Error.WriteLine(new string('a', 30000));
|
|
||||||
Console.Error.Flush();
|
|
||||||
break;
|
|
||||||
case "CheckLogFile":
|
|
||||||
Console.WriteLine($"Random number: {args[1]}");
|
|
||||||
break;
|
|
||||||
case "CheckErrLogFile":
|
|
||||||
Console.Error.WriteLine($"Random number: {args[1]}");
|
|
||||||
Console.Error.Flush();
|
|
||||||
break;
|
|
||||||
case "CheckOversizedStdErrWrites":
|
|
||||||
Console.WriteLine(new string('a', 31000));
|
|
||||||
break;
|
|
||||||
case "CheckOversizedStdOutWrites":
|
|
||||||
Console.Error.WriteLine(new string('a', 31000));
|
|
||||||
Console.Error.Flush();
|
|
||||||
break;
|
|
||||||
case "Hang":
|
|
||||||
Thread.Sleep(Timeout.Infinite);
|
|
||||||
break;
|
|
||||||
case "Throw":
|
|
||||||
throw new InvalidOperationException("Program.Main exception");
|
|
||||||
case "HangOnStop":
|
|
||||||
var host = new WebHostBuilder()
|
|
||||||
.UseIIS()
|
|
||||||
.UseStartup<Startup>()
|
|
||||||
.Build();
|
|
||||||
host.Run();
|
|
||||||
|
|
||||||
Thread.Sleep(Timeout.Infinite);
|
|
||||||
break;
|
|
||||||
case "CheckConsoleFunctions":
|
|
||||||
// Call a bunch of console functions and make sure none return invalid handle.
|
|
||||||
Console.OutputEncoding = Encoding.UTF8;
|
|
||||||
Console.Title = "Test";
|
|
||||||
Console.WriteLine($"Is Console redirection: {Console.IsOutputRedirected}");
|
|
||||||
Console.BackgroundColor = ConsoleColor.Blue;
|
|
||||||
Console.WriteLine("彡⾔");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class Startup
|
|
||||||
{
|
|
||||||
public void Configure(IApplicationBuilder app)
|
|
||||||
{
|
|
||||||
app.Run(async context => await context.Response.WriteAsync("OK"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
{
|
|
||||||
"iisSettings": {
|
|
||||||
"windowsAuthentication": true,
|
|
||||||
"anonymousAuthentication": true,
|
|
||||||
"iisExpress": {
|
|
||||||
"applicationUrl": "http://localhost:5762/",
|
|
||||||
"sslPort": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"profiles": {
|
|
||||||
"ANCM IIS Express": {
|
|
||||||
"commandName": "Executable",
|
|
||||||
"executablePath": "$(IISExpressPath)",
|
|
||||||
"commandLineArgs": "$(IISExpressArguments)",
|
|
||||||
"nativeDebugging": true,
|
|
||||||
"environmentVariables": {
|
|
||||||
"IIS_SITE_PATH": "$(MSBuildThisFileDirectory)",
|
|
||||||
"ANCM_PATH": "$(TargetDir)\\$(AncmPath)",
|
|
||||||
"ANCMV2_PATH": "$(TargetDir)\\$(AncmV2Path)",
|
|
||||||
"LAUNCHER_ARGS": "$(TargetPath)",
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
|
||||||
"LAUNCHER_PATH": "$(DotNetPath)",
|
|
||||||
"ASPNETCORE_MODULE_DEBUG": "console"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ANCM IIS": {
|
|
||||||
"commandName": "Executable",
|
|
||||||
"executablePath": "$(IISPath)",
|
|
||||||
"commandLineArgs": "$(IISArguments)",
|
|
||||||
"environmentVariables": {
|
|
||||||
"IIS_SITE_PATH": "$(MSBuildThisFileDirectory)",
|
|
||||||
"ANCM_PATH": "$(AncmPath)",
|
|
||||||
"ANCMV2_PATH": "$(AncmV2Path)",
|
|
||||||
"LAUNCHER_ARGS": "$(TargetPath)",
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
|
||||||
"LAUNCHER_PATH": "$(DotNetPath)",
|
|
||||||
"ASPNETCORE_MODULE_DEBUG": "console"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
|
|
||||||
<InProcessTestSite>true</InProcessTestSite>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\testsite.props" />
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Server.IIS\Microsoft.AspNetCore.Server.IIS.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<system.webServer>
|
|
||||||
<handlers>
|
|
||||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
|
||||||
</handlers>
|
|
||||||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" hostingModel="inprocess">
|
|
||||||
</aspNetCore>
|
|
||||||
</system.webServer>
|
|
||||||
</configuration>
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
// 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.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
|
namespace TestSite
|
||||||
|
{
|
||||||
|
public partial class Startup
|
||||||
|
{
|
||||||
|
private async Task HostingEnvironment(HttpContext ctx)
|
||||||
|
{
|
||||||
|
var hostingEnv = ctx.RequestServices.GetService<IHostingEnvironment>();
|
||||||
|
|
||||||
|
await ctx.Response.WriteAsync("ContentRootPath " + hostingEnv.ContentRootPath + Environment.NewLine);
|
||||||
|
await ctx.Response.WriteAsync("WebRootPath " + hostingEnv.WebRootPath + Environment.NewLine);
|
||||||
|
await ctx.Response.WriteAsync("CurrentDirectory " + Environment.CurrentDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ConsoleWrite(HttpContext ctx)
|
||||||
|
{
|
||||||
|
Console.WriteLine("TEST MESSAGE");
|
||||||
|
|
||||||
|
await ctx.Response.WriteAsync("Hello World");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ConsoleErrorWrite(HttpContext ctx)
|
||||||
|
{
|
||||||
|
Console.Error.WriteLine("TEST MESSAGE");
|
||||||
|
|
||||||
|
await ctx.Response.WriteAsync("Hello World");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue