Enabling native module variations.
These do no run unless a machine has native module setup done and an environment variable named IIS_NATIVE_MODULE_SETUP=true. So the test will get skipped on pretty much on all machines except the ones where we want to run on.
This commit is contained in:
parent
4315eb231f
commit
51f60d5fd5
|
|
@ -6,6 +6,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Xml;
|
||||||
using Microsoft.Framework.Runtime;
|
using Microsoft.Framework.Runtime;
|
||||||
using Microsoft.Framework.Runtime.Infrastructure;
|
using Microsoft.Framework.Runtime.Infrastructure;
|
||||||
|
|
||||||
|
|
@ -105,6 +106,21 @@ namespace E2ETests
|
||||||
overrideConfig = Path.GetFullPath(overrideConfig);
|
overrideConfig = Path.GetFullPath(overrideConfig);
|
||||||
File.WriteAllText(overrideConfig, "{\"UseInMemoryStore\": \"true\"}");
|
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);
|
Thread.Sleep(1 * 1000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -349,7 +365,10 @@ namespace E2ETests
|
||||||
if (startParameters.ServerType == ServerType.IISNativeModule)
|
if (startParameters.ServerType == ServerType.IISNativeModule)
|
||||||
{
|
{
|
||||||
// Stop & delete the application pool.
|
// Stop & delete the application pool.
|
||||||
startParameters.IISApplication.StopAndDeleteAppPool();
|
if (startParameters.IISApplication != null)
|
||||||
|
{
|
||||||
|
startParameters.IISApplication.StopAndDeleteAppPool();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (hostProcess != null && !hostProcess.HasExited)
|
else if (hostProcess != null && !hostProcess.HasExited)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,16 +43,16 @@ namespace E2ETests
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (serverType == ServerType.IISNativeModule &&
|
if (serverType == ServerType.IISNativeModule &&
|
||||||
// Environment.GetEnvironmentVariable("IIS_NATIVE_MODULE_SETUP") != "true")
|
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
|
// 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.
|
// variable to true to run the native module variation.
|
||||||
// // TODO: Need a better way to detect native module on the machine.
|
// 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("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.");
|
Console.WriteLine("Setup the native module and set the IIS_NATIVE_MODULE_SETUP to true to run the variation.");
|
||||||
// return true;
|
return true;
|
||||||
//}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ namespace E2ETests
|
||||||
[InlineData(ServerType.Kestrel, KreFlavor.Mono, KreArchitecture.x86, "http://localhost:5004/", true)]
|
[InlineData(ServerType.Kestrel, KreFlavor.Mono, KreArchitecture.x86, "http://localhost:5004/", true)]
|
||||||
[InlineData(ServerType.Helios, KreFlavor.CoreClr, KreArchitecture.amd64, "http://localhost:5001/", false)]
|
[InlineData(ServerType.Helios, KreFlavor.CoreClr, KreArchitecture.amd64, "http://localhost:5001/", false)]
|
||||||
[InlineData(ServerType.Kestrel, KreFlavor.CoreClr, KreArchitecture.amd64, "http://localhost:5004/", 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.x86, "http://localhost:5005/", false)]
|
||||||
//[InlineData(ServerType.IISNativeModule, KreFlavor.CoreClr, KreArchitecture.amd64, "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)
|
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);
|
Console.WriteLine("Variation Details : HostType = {0}, KreFlavor = {1}, Architecture = {2}, applicationBaseUrl = {3}", serverType, kreFlavor, architecture, applicationBaseUrl);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue