diff --git a/test/E2ETests/DeploymentUtility.cs b/test/E2ETests/DeploymentUtility.cs index 8dfd21c889..245c660be1 100644 --- a/test/E2ETests/DeploymentUtility.cs +++ b/test/E2ETests/DeploymentUtility.cs @@ -53,6 +53,37 @@ namespace E2ETests } } + /// + /// Copy klr.iis\[arch] to bin folder + /// + /// + private static void CopyKlrIIsBinFolder(StartParameters startParameters) + { + if (startParameters.ServerType == ServerType.HeliosNativeModule) + { + Console.WriteLine(@"Copying klr.iis\x86\* content to [ApplicationFolder]\bin\"); + var archFolderName = startParameters.KreArchitecture.ToString(); + var sourcePath = Path.Combine(Environment.CurrentDirectory, "NativeModule", "klr.iis", archFolderName); + var targetPath = Path.Combine(startParameters.ApplicationPath, "bin", archFolderName); + if (!Directory.Exists(targetPath)) + { + Directory.CreateDirectory(targetPath); + } + + try + { + foreach (var sourceFile in Directory.EnumerateFiles(sourcePath, "*", SearchOption.AllDirectories)) + { + File.Copy(sourceFile, Path.Combine(targetPath, Path.GetFileName(sourceFile)), true); + } + } + catch (Exception exception) + { + Console.WriteLine("Exception while copying assemblies", exception.Message); + } + } + } + private static string APP_RELATIVE_PATH = Path.Combine("..", "..", "src", "MusicStore"); public static Process StartApplication(StartParameters startParameters, string identityDbName) @@ -86,7 +117,7 @@ namespace E2ETests KpmPack(startParameters); } - if (startParameters.ServerType == ServerType.Helios) + if (startParameters.ServerType == ServerType.Helios || startParameters.ServerType == ServerType.HeliosNativeModule) { hostProcess = StartHeliosHost(startParameters); } @@ -146,20 +177,42 @@ namespace E2ETests private static Process StartHeliosHost(StartParameters startParameters) { - CopyAspNetLoader(startParameters.ApplicationPath); + if (!string.IsNullOrWhiteSpace(startParameters.ApplicationHostConfigTemplateContent)) + { + startParameters.ApplicationHostConfigTemplateContent = + startParameters.ApplicationHostConfigTemplateContent.Replace("[ApplicationPhysicalPath]", startParameters.ApplicationPath); + } + + if (startParameters.ServerType == ServerType.HeliosNativeModule) + { + startParameters.ApplicationHostConfigTemplateContent = + startParameters.ApplicationHostConfigTemplateContent. + Replace("[KlrBootStrapperDirectory]", Path.Combine(Environment.CurrentDirectory, "NativeModule", "klr.iis.bootstrapper")); + } + + if (startParameters.ServerType == ServerType.Helios) + { + CopyAspNetLoader(startParameters.ApplicationPath); + } + else + { + //Native module + CopyKlrIIsBinFolder(startParameters); + } if (!string.IsNullOrWhiteSpace(startParameters.ApplicationHostConfigTemplateContent)) { //Pass on the applicationhost.config to iis express. With this don't need to pass in the /path /port switches as they are in the applicationHost.config //We take a copy of the original specified applicationHost.Config to prevent modifying the one in the repo. + var tempApplicationHostConfig = Path.GetTempFileName(); File.WriteAllText(tempApplicationHostConfig, startParameters.ApplicationHostConfigTemplateContent.Replace("[ApplicationPhysicalPath]", startParameters.ApplicationPath)); startParameters.ApplicationHostConfigLocation = tempApplicationHostConfig; } var parameters = string.IsNullOrWhiteSpace(startParameters.ApplicationHostConfigLocation) ? - string.Format("/port:5001 /path:{0}", startParameters.ApplicationPath) : - string.Format("/site:{0} /config:{1}", startParameters.SiteName, startParameters.ApplicationHostConfigLocation); + string.Format("/port:5001 /path:{0}", startParameters.ApplicationPath) : + string.Format("/site:{0} /config:{1}", startParameters.SiteName, startParameters.ApplicationHostConfigLocation); var iisExpressPath = GetIISExpressPath(startParameters.KreArchitecture); diff --git a/test/E2ETests/HeliosNativeModuleApplicationHost.config b/test/E2ETests/HeliosNativeModuleApplicationHost.config new file mode 100644 index 0000000000..a42e207737 --- /dev/null +++ b/test/E2ETests/HeliosNativeModuleApplicationHost.config @@ -0,0 +1,1036 @@ + + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.dll b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.dll new file mode 100644 index 0000000000..ffeb557cde Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.dll differ diff --git a/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.dll.lastcodeanalysissucceeded b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.dll.lastcodeanalysissucceeded new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.exp b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.exp new file mode 100644 index 0000000000..737728550b Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.exp differ diff --git a/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.ilk b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.ilk new file mode 100644 index 0000000000..8d1b038988 Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.ilk differ diff --git a/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.lib b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.lib new file mode 100644 index 0000000000..8f0602d5d2 Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.lib differ diff --git a/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.pdb b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.pdb new file mode 100644 index 0000000000..73569487ec Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis.bootstrapper/klr.iis.bootstrapper.pdb differ diff --git a/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.dll b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.dll new file mode 100644 index 0000000000..cde22ba6e5 Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.dll differ diff --git a/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.dll.lastcodeanalysissucceeded b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.dll.lastcodeanalysissucceeded new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.exp b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.exp new file mode 100644 index 0000000000..1aae434aec Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.exp differ diff --git a/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.ilk b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.ilk new file mode 100644 index 0000000000..b9e1d6ad56 Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.ilk differ diff --git a/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.lib b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.lib new file mode 100644 index 0000000000..6f28b2c60a Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.lib differ diff --git a/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.pdb b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.pdb new file mode 100644 index 0000000000..58a28778f0 Binary files /dev/null and b/test/E2ETests/NativeModule/klr.iis/x86/klr.iis.pdb differ diff --git a/test/E2ETests/ServerType.cs b/test/E2ETests/ServerType.cs index a71186357a..aa10657c47 100644 --- a/test/E2ETests/ServerType.cs +++ b/test/E2ETests/ServerType.cs @@ -3,6 +3,7 @@ public enum ServerType { Helios, + HeliosNativeModule, WebListener, Kestrel } diff --git a/test/E2ETests/SmokeTests.cs b/test/E2ETests/SmokeTests.cs index 3a5e321343..7767598398 100644 --- a/test/E2ETests/SmokeTests.cs +++ b/test/E2ETests/SmokeTests.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.IO; using System.Net.Http; using Xunit; @@ -24,7 +25,9 @@ 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)] - public void SmokeTestSuite(ServerType serverType, KreFlavor kreFlavor, KreArchitecture architecture, string applicationBaseUrl, bool RunTestOnMono = false) + //Native module variation requires some more work + //[InlineData(ServerType.HeliosNativeModule, KreFlavor.CoreClr, KreArchitecture.x86, "http://localhost:5001/", 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); @@ -38,7 +41,9 @@ namespace E2ETests { ServerType = serverType, KreFlavor = kreFlavor, - KreArchitecture = architecture + KreArchitecture = architecture, + ApplicationHostConfigTemplateContent = (serverType == ServerType.HeliosNativeModule) ? File.ReadAllText("HeliosNativeModuleApplicationHost.config") : null, + SiteName = (serverType == ServerType.HeliosNativeModule) ? "MusicStoreNativeModule" : null }; var testStartTime = DateTime.Now;