diff --git a/test/E2ETests/DeploymentUtility.cs b/test/E2ETests/DeploymentUtility.cs index dc17d7b5cc..ae0b7f1163 100644 --- a/test/E2ETests/DeploymentUtility.cs +++ b/test/E2ETests/DeploymentUtility.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading; +using System.Xml; using Microsoft.Framework.Runtime; using Microsoft.Framework.Runtime.Infrastructure; @@ -105,6 +106,21 @@ namespace E2ETests overrideConfig = Path.GetFullPath(overrideConfig); File.WriteAllText(overrideConfig, "{\"UseInMemoryStore\": \"true\"}"); + // Set runAllManagedModulesForAllRequests=true + var webConfig = Path.Combine(startParameters.ApplicationPath, "web.config"); + var configuration = new XmlDocument(); + configuration.LoadXml(File.ReadAllText(webConfig)); + + // https://github.com/aspnet/Helios/issues/77 + var rammfarAttribute = configuration.CreateAttribute("runAllManagedModulesForAllRequests"); + rammfarAttribute.Value = "true"; + var modulesNode = configuration.CreateElement("modules"); + modulesNode.Attributes.Append(rammfarAttribute); + var systemWebServerNode = configuration.CreateElement("system.webServer"); + systemWebServerNode.AppendChild(modulesNode); + configuration.SelectSingleNode("//configuration").AppendChild(systemWebServerNode); + configuration.Save(webConfig); + Thread.Sleep(1 * 1000); } else @@ -349,7 +365,10 @@ namespace E2ETests if (startParameters.ServerType == ServerType.IISNativeModule) { // Stop & delete the application pool. - startParameters.IISApplication.StopAndDeleteAppPool(); + if (startParameters.IISApplication != null) + { + startParameters.IISApplication.StopAndDeleteAppPool(); + } } else if (hostProcess != null && !hostProcess.HasExited) { diff --git a/test/E2ETests/Helpers.cs b/test/E2ETests/Helpers.cs index 20e92278b7..8462c0fe3c 100644 --- a/test/E2ETests/Helpers.cs +++ b/test/E2ETests/Helpers.cs @@ -43,16 +43,16 @@ namespace E2ETests return true; } - //if (serverType == ServerType.IISNativeModule && - // Environment.GetEnvironmentVariable("IIS_NATIVE_MODULE_SETUP") != "true") - //{ - // // Native module variations require IIS setup. Once native module is setup on IIS, set the value of the environment - // // variable to true to run the native module variation. - // // TODO: Need a better way to detect native module on the machine. - // Console.WriteLine("Skipping Native module test since native module is not installed on IIS."); - // Console.WriteLine("Setup the native module and set the IIS_NATIVE_MODULE_SETUP to true to run the variation."); - // return true; - //} + if (serverType == ServerType.IISNativeModule && + Environment.GetEnvironmentVariable("IIS_NATIVE_MODULE_SETUP") != "true") + { + // Native module variations require IIS setup. Once native module is setup on IIS, set the value of the environment + // variable to true to run the native module variation. + // TODO: Need a better way to detect native module on the machine. + Console.WriteLine("Skipping Native module test since native module is not installed on IIS."); + Console.WriteLine("Setup the native module and set the IIS_NATIVE_MODULE_SETUP to true to run the variation."); + return true; + } return false; } diff --git a/test/E2ETests/SmokeTests.cs b/test/E2ETests/SmokeTests.cs index c1a0677d1b..4f6bc22543 100644 --- a/test/E2ETests/SmokeTests.cs +++ b/test/E2ETests/SmokeTests.cs @@ -27,8 +27,8 @@ namespace E2ETests [InlineData(ServerType.Kestrel, KreFlavor.Mono, KreArchitecture.x86, "http://localhost:5004/", true)] [InlineData(ServerType.Helios, KreFlavor.CoreClr, KreArchitecture.amd64, "http://localhost:5001/", false)] [InlineData(ServerType.Kestrel, KreFlavor.CoreClr, KreArchitecture.amd64, "http://localhost:5004/", false)] - //[InlineData(ServerType.IISNativeModule, KreFlavor.CoreClr, KreArchitecture.x86, "http://localhost:5005/", false)] - //[InlineData(ServerType.IISNativeModule, KreFlavor.CoreClr, KreArchitecture.amd64, "http://localhost:5005/", false)] + [InlineData(ServerType.IISNativeModule, KreFlavor.CoreClr, KreArchitecture.x86, "http://localhost:5005/", false)] + [InlineData(ServerType.IISNativeModule, KreFlavor.CoreClr, KreArchitecture.amd64, "http://localhost:5005/", false)] public void SmokeTestSuite(ServerType serverType, KreFlavor kreFlavor, KreArchitecture architecture, string applicationBaseUrl, bool runTestOnMono) { Console.WriteLine("Variation Details : HostType = {0}, KreFlavor = {1}, Architecture = {2}, applicationBaseUrl = {3}", serverType, kreFlavor, architecture, applicationBaseUrl);