From 2cbe83832cc76aa379b29665de5523e82c543acf Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 1 May 2021 23:58:21 -0500 Subject: Add test for 5GB external payload. --- .gitignore | 2 + src/TestData/CacheTests/BundleC/BundleC.wixproj | 26 ++ src/TestData/CacheTests/BundleC/BundleC.wxs | 12 + src/TestExe/NetfxTask.cs | 295 +++++++++++++++++++++ src/TestExe/Task.cs | 330 +++--------------------- src/TestExe/TestExe.csproj | 7 +- src/WixToolsetTest.BurnE2E/CacheTests.cs | 27 ++ 7 files changed, 401 insertions(+), 298 deletions(-) create mode 100644 src/TestData/CacheTests/BundleC/BundleC.wixproj create mode 100644 src/TestData/CacheTests/BundleC/BundleC.wxs create mode 100644 src/TestExe/NetfxTask.cs diff --git a/.gitignore b/.gitignore index 3e8a1553..1075e999 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +src/TestData/CacheTests/BundleC/fivegb.file + # User-specific files *.rsuser *.suo diff --git a/src/TestData/CacheTests/BundleC/BundleC.wixproj b/src/TestData/CacheTests/BundleC/BundleC.wixproj new file mode 100644 index 00000000..0acc29c4 --- /dev/null +++ b/src/TestData/CacheTests/BundleC/BundleC.wixproj @@ -0,0 +1,26 @@ + + + + Bundle + {997BDF9A-2540-42DB-8F86-296BA243194B} + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TestData/CacheTests/BundleC/BundleC.wxs b/src/TestData/CacheTests/BundleC/BundleC.wxs new file mode 100644 index 00000000..ca21cc6e --- /dev/null +++ b/src/TestData/CacheTests/BundleC/BundleC.wxs @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/TestExe/NetfxTask.cs b/src/TestExe/NetfxTask.cs new file mode 100644 index 00000000..35b1ea95 --- /dev/null +++ b/src/TestExe/NetfxTask.cs @@ -0,0 +1,295 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#if NET35 +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Management; +using Microsoft.Win32; + +namespace TestExe +{ + public class ProcessInfoTask : Task + { + public ProcessInfoTask(string Data) : base(Data) { } + + public override void RunTask() + { + try + { + string processInfoXml = ""; + + // Get information about the process and who is running it + Process thisProc = Process.GetCurrentProcess(); + string username = thisProc.StartInfo.EnvironmentVariables["username"].ToString(); + + int parentProcId = GetParentProcess(thisProc.Id); + Process parentProc = Process.GetProcessById(parentProcId); + string parentUsername = parentProc.StartInfo.EnvironmentVariables["username"].ToString(); + + int grandparentProcId = GetParentProcess(parentProc.Id); + Process grandparentProc = Process.GetProcessById(grandparentProcId); + string grandparentUsername = grandparentProc.StartInfo.EnvironmentVariables["username"].ToString(); + + processInfoXml += ""; + processInfoXml += " " + thisProc.ProcessName + ""; + processInfoXml += " " + thisProc.Id.ToString() + ""; + processInfoXml += " " + thisProc.SessionId.ToString() + ""; + processInfoXml += " " + thisProc.MachineName + ""; + // this stuff isn't set since we didn't start the process and tell it what to use. So don't bother + //processInfoXml += " "; + //processInfoXml += " " + thisProc.StartInfo.FileName + ""; + //processInfoXml += " " + thisProc.StartInfo.UserName + ""; + //processInfoXml += " " + thisProc.StartInfo.WorkingDirectory + ""; + //processInfoXml += " " + thisProc.StartInfo.Arguments + ""; + //processInfoXml += " "; + processInfoXml += " " + thisProc.StartTime.ToString() + ""; + processInfoXml += " " + username + ""; + processInfoXml += " "; + processInfoXml += " " + parentProc.ProcessName + ""; + processInfoXml += " " + parentProc.Id.ToString() + ""; + processInfoXml += " " + parentProc.StartTime.ToString() + ""; + processInfoXml += " " + parentUsername + ""; + processInfoXml += " "; + processInfoXml += " "; + processInfoXml += " " + grandparentProc.ProcessName + ""; + processInfoXml += " " + grandparentProc.Id.ToString() + ""; + processInfoXml += " " + grandparentProc.StartTime.ToString() + ""; + processInfoXml += " " + grandparentUsername + ""; + processInfoXml += " "; + processInfoXml += ""; + + string logFile = System.Environment.ExpandEnvironmentVariables(this.data); + Console.WriteLine("Creating Process Info data file: " + logFile); + StreamWriter textFile = File.CreateText(logFile); + textFile.WriteLine(processInfoXml); + textFile.Close(); + } + catch (Exception eX) + { + Console.WriteLine("Creating Process Info data file failed"); + Console.WriteLine(eX.Message); + } + + + } + + private static int GetParentProcess(int Id) + { + int parentPid = 0; + using (ManagementObject mo = new ManagementObject("win32_process.handle='" + Id.ToString() + "'")) + { + mo.Get(); + parentPid = Convert.ToInt32(mo["ParentProcessId"]); + } + return parentPid; + } + } + + /// + /// Task class that will create a registry key and write a name and value in it + /// + public class RegistryWriterTask : Task + { + private string hive; + private string keyPath; + private string[] keyPathArray; + private string name; + private RegistryValueKind regValueKind; + private object value; + + public RegistryWriterTask(string Data) : base(Data) { } + + public override void RunTask() + { + if (this.parseRegKeyNameTypeValue(System.Environment.ExpandEnvironmentVariables(this.data))) + { + RegistryKey rk = Registry.LocalMachine; + + if (this.hive == "HKCU") { rk = Microsoft.Win32.Registry.CurrentUser; } + if (this.hive == "HKCC") { rk = Microsoft.Win32.Registry.CurrentConfig; } + if (this.hive == "HKLM") { rk = Microsoft.Win32.Registry.LocalMachine; } + + foreach (string key in this.keyPathArray) + { + rk = rk.CreateSubKey(key, RegistryKeyPermissionCheck.ReadWriteSubTree); + } + + rk.SetValue(this.name, this.value, this.regValueKind); + Console.WriteLine("Created registry key: '{0}' name: '{1}' value: '{2}' of type: '{3}'", + this.hive + "\\" + this.keyPath, + this.name, + this.value.ToString(), + this.regValueKind.ToString()); + } + else + { + Console.WriteLine("Unable to write registry key."); + } + + } + + private bool parseRegKeyNameTypeValue(string delimittedData) + { + string[] splitString = delimittedData.Split(new string[] { "," }, StringSplitOptions.None); + if (splitString.Length != 4) + { + Console.WriteLine("Invalid regkey. Unable to parse key,name,type,value from: \"" + delimittedData + "\""); + return false; + } + else + { + this.keyPath = splitString[0]; + this.name = splitString[1]; + string datatype = splitString[2]; + if (datatype == "DWord") + { + this.value = UInt32.Parse(splitString[3]); + } + else if (datatype == "QWord") + { + this.value = UInt64.Parse(splitString[3]); + } + else + { + this.value = splitString[3]; + } + + if (this.keyPath.ToUpper().StartsWith("HKLM\\")) + { + this.hive = "HKLM"; + this.keyPath = this.keyPath.Replace("HKLM\\", ""); + } + else if (this.keyPath.ToUpper().StartsWith("HKCC\\")) + { + this.hive = "HKCC"; + this.keyPath = this.keyPath.Replace("HKCC\\", ""); + } + else if (this.keyPath.ToUpper().StartsWith("HKCU\\")) + { + this.hive = "HKCU"; + this.keyPath = this.keyPath.Replace("HKCU\\", ""); + } + else + { + Console.WriteLine("Invalid regkey. Unable to determin hive. regkey must start with either: [HKLM], [HKCU], or [HKCC]"); + return false; + } + this.keyPathArray = this.keyPath.Split(new string[] { "\\" }, StringSplitOptions.None); + + try + { + this.regValueKind = (RegistryValueKind)System.Enum.Parse(typeof(RegistryValueKind), datatype); + } + catch (Exception ex) + { + Console.WriteLine("Invalid datatype. It must be: String, DWord, or QWord (case sensitive)"); + Console.WriteLine(ex.Message); + return false; + } + } + return true; + } + } + + /// + /// Task class that will delete a registry key value or registry key and all of its children + /// + public class RegistryDeleterTask : Task + { + private string hive; + private string keyPath; + private string[] keyPathArray; + private string name; + + public RegistryDeleterTask(string Data) : base(Data) { } + + public override void RunTask() + { + if (this.parseRegKeyName(System.Environment.ExpandEnvironmentVariables(this.data))) + { + try + { + RegistryKey rk = Registry.LocalMachine; + + if (this.hive == "HKCU") { rk = Microsoft.Win32.Registry.CurrentUser; } + if (this.hive == "HKCC") { rk = Microsoft.Win32.Registry.CurrentConfig; } + if (this.hive == "HKLM") { rk = Microsoft.Win32.Registry.LocalMachine; } + + RegistryKey rkParent = null; + foreach (string key in this.keyPathArray) + { + rkParent = rk; + rk = rk.OpenSubKey(key, true); + } + + if (String.IsNullOrEmpty(this.name)) + { + // delete the key and all of its children + string subkeyToDelete = this.keyPathArray[this.keyPathArray.Length - 1]; + rkParent.DeleteSubKeyTree(subkeyToDelete); + Console.WriteLine("Deleted registry key: '{0}'", this.hive + "\\" + this.keyPath); + } + else + { + // just delete this value + rk.DeleteValue(this.name); + Console.WriteLine("Deleted registry key: '{0}' name: '{1}'", this.hive + "\\" + this.keyPath, this.name); + } + } + catch (Exception ex) + { + Console.WriteLine("Unable to delete registry key: '{0}'", this.hive + "\\" + this.keyPath); + Console.WriteLine(ex.Message); + } + } + else + { + Console.WriteLine("Unable to delete registry key."); + } + + } + + private bool parseRegKeyName(string delimittedData) + { + string[] splitString = delimittedData.Split(new string[] { "," }, StringSplitOptions.None); + + if (splitString.Length > 2) + { + Console.WriteLine("Unable to parse registry key and name."); + return false; + } + + this.keyPath = splitString[0]; + if (splitString.Length == 2) + { + this.name = splitString[1]; + } + + if (this.keyPath.ToUpper().StartsWith("HKLM\\")) + { + this.hive = "HKLM"; + this.keyPath = this.keyPath.Replace("HKLM\\", ""); + } + else if (this.keyPath.ToUpper().StartsWith("HKCC\\")) + { + this.hive = "HKCC"; + this.keyPath = this.keyPath.Replace("HKCC\\", ""); + } + else if (this.keyPath.ToUpper().StartsWith("HKCU\\")) + { + this.hive = "HKCU"; + this.keyPath = this.keyPath.Replace("HKCU\\", ""); + } + else + { + Console.WriteLine("Invalid regkey. Unable to determine hive. regkey must start with either: [HKLM], [HKCU], or [HKCC]"); + return false; + } + this.keyPathArray = this.keyPath.Split(new string[] { "\\" }, StringSplitOptions.None); + return true; + } + } +} +#endif diff --git a/src/TestExe/Task.cs b/src/TestExe/Task.cs index 577acbea..7d39bfd9 100644 --- a/src/TestExe/Task.cs +++ b/src/TestExe/Task.cs @@ -4,9 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq; -using System.Management; -using System.Text; using Microsoft.Win32; namespace TestExe @@ -17,7 +14,7 @@ namespace TestExe public Task(string Data) { - data = Data; + this.data = Data; } public abstract void RunTask(); @@ -52,8 +49,8 @@ namespace TestExe public override void RunTask() { - int low = int.Parse(data.Split(new string[] { ":" }, 2, StringSplitOptions.None)[0]); - int high = int.Parse(data.Split(new string[] { ":" }, 2, StringSplitOptions.None)[1]); + int low = int.Parse(this.data.Split(new string[] { ":" }, 2, StringSplitOptions.None)[0]); + int high = int.Parse(this.data.Split(new string[] { ":" }, 2, StringSplitOptions.None)[1]); Random r = new Random(); int milliseconds = r.Next(high - low) + low; @@ -62,13 +59,30 @@ namespace TestExe } } + public class LargeFileTask : Task + { + public LargeFileTask(string Data) : base(Data) { } + + public override void RunTask() + { + string[] tokens = this.data.Split(new char[] { '|' }, 2); + string filePath = System.Environment.ExpandEnvironmentVariables(tokens[0]); + long size = long.Parse(tokens[1]); + using (var stream = File.Create(filePath)) + { + stream.Seek(size - 1, SeekOrigin.Begin); + stream.WriteByte(1); + } + } + } + public class LogTask : Task { string[] argsUsed; public LogTask(string Data, string[] args) : base(Data) { - argsUsed = args; + this.argsUsed = args; } public override void RunTask() @@ -76,14 +90,14 @@ namespace TestExe string logFile = ""; string argsUsedString = ""; - foreach (string a in argsUsed) + foreach (string a in this.argsUsed) { argsUsedString += a + " "; } try { - logFile = System.Environment.ExpandEnvironmentVariables(data); + logFile = System.Environment.ExpandEnvironmentVariables(this.data); Console.WriteLine("creating log file: " + logFile); StreamWriter textFile = File.CreateText(logFile); textFile.WriteLine("This is a log file created by TestExe.exe"); @@ -98,90 +112,13 @@ namespace TestExe } } - public class ProcessInfoTask : Task - { - public ProcessInfoTask(string Data) : base(Data) { } - - public override void RunTask() - { - try - { - string processInfoXml = ""; - - // Get information about the process and who is running it - Process thisProc = Process.GetCurrentProcess(); - string username = thisProc.StartInfo.EnvironmentVariables["username"].ToString(); - - int parentProcId = GetParentProcess(thisProc.Id); - Process parentProc = Process.GetProcessById(parentProcId); - string parentUsername = parentProc.StartInfo.EnvironmentVariables["username"].ToString(); - - int grandparentProcId = GetParentProcess(parentProc.Id); - Process grandparentProc = Process.GetProcessById(grandparentProcId); - string grandparentUsername = grandparentProc.StartInfo.EnvironmentVariables["username"].ToString(); - - processInfoXml += ""; - processInfoXml += " " + thisProc.ProcessName + ""; - processInfoXml += " " + thisProc.Id.ToString() + ""; - processInfoXml += " " + thisProc.SessionId.ToString() + ""; - processInfoXml += " " + thisProc.MachineName + ""; - // this stuff isn't set since we didn't start the process and tell it what to use. So don't bother - //processInfoXml += " "; - //processInfoXml += " " + thisProc.StartInfo.FileName + ""; - //processInfoXml += " " + thisProc.StartInfo.UserName + ""; - //processInfoXml += " " + thisProc.StartInfo.WorkingDirectory + ""; - //processInfoXml += " " + thisProc.StartInfo.Arguments + ""; - //processInfoXml += " "; - processInfoXml += " " + thisProc.StartTime.ToString() + ""; - processInfoXml += " " + username + ""; - processInfoXml += " "; - processInfoXml += " " + parentProc.ProcessName + ""; - processInfoXml += " " + parentProc.Id.ToString() + ""; - processInfoXml += " " + parentProc.StartTime.ToString() + ""; - processInfoXml += " " + parentUsername + ""; - processInfoXml += " "; - processInfoXml += " "; - processInfoXml += " " + grandparentProc.ProcessName + ""; - processInfoXml += " " + grandparentProc.Id.ToString() + ""; - processInfoXml += " " + grandparentProc.StartTime.ToString() + ""; - processInfoXml += " " + grandparentUsername + ""; - processInfoXml += " "; - processInfoXml += ""; - - string logFile = System.Environment.ExpandEnvironmentVariables(data); - Console.WriteLine("Creating Process Info data file: " + logFile); - StreamWriter textFile = File.CreateText(logFile); - textFile.WriteLine(processInfoXml); - textFile.Close(); - } - catch (Exception eX) - { - Console.WriteLine("Creating Process Info data file failed"); - Console.WriteLine(eX.Message); - } - - - } - - private static int GetParentProcess(int Id) - { - int parentPid = 0; - using (ManagementObject mo = new ManagementObject("win32_process.handle='" + Id.ToString() + "'")) - { - mo.Get(); - parentPid = Convert.ToInt32(mo["ParentProcessId"]); - } - return parentPid; - } - } - public class FileExistsTask : Task { public FileExistsTask(string Data) : base(Data) { } public override void RunTask() { - string fileToExist = System.Environment.ExpandEnvironmentVariables(data); + string fileToExist = System.Environment.ExpandEnvironmentVariables(this.data); if (!String.IsNullOrEmpty(fileToExist)) { @@ -196,211 +133,6 @@ namespace TestExe } } - /// - /// Task class that will create a registry key and write a name and value in it - /// - public class RegistryWriterTask : Task - { - private string hive; - private string keyPath; - private string[] keyPathArray; - private string name; - private RegistryValueKind regValueKind; - private object value; - - public RegistryWriterTask(string Data) : base(Data) { } - - public override void RunTask() - { - if (parseRegKeyNameTypeValue(System.Environment.ExpandEnvironmentVariables(data))) - { - RegistryKey rk = Registry.LocalMachine; - - if (hive == "HKCU") rk = Microsoft.Win32.Registry.CurrentUser; - if (hive == "HKCC") rk = Microsoft.Win32.Registry.CurrentConfig; - if (hive == "HKLM") rk = Microsoft.Win32.Registry.LocalMachine; - - foreach (string key in keyPathArray) - { - rk = rk.CreateSubKey(key, RegistryKeyPermissionCheck.ReadWriteSubTree); - } - - rk.SetValue(name, value, regValueKind); - Console.WriteLine("Created registry key: '{0}' name: '{1}' value: '{2}' of type: '{3}'", - hive + "\\" + keyPath, - name, - value.ToString(), - regValueKind.ToString()); - } - else - { - Console.WriteLine("Unable to write registry key."); - } - - } - - private bool parseRegKeyNameTypeValue(string delimittedData) - { - string[] splitString = delimittedData.Split(new string[] { "," }, StringSplitOptions.None); - if (splitString.Length != 4) - { - Console.WriteLine("Invalid regkey. Unable to parse key,name,type,value from: \"" + delimittedData + "\""); - return false; - } - else - { - keyPath = splitString[0]; - name = splitString[1]; - string datatype = splitString[2]; - if (datatype == "DWord") - { - value = UInt32.Parse(splitString[3]); - } - else if (datatype == "QWord") - { - value = UInt64.Parse(splitString[3]); - } - else - { - value = splitString[3]; - } - - if (keyPath.ToUpper().StartsWith("HKLM\\")) - { - hive = "HKLM"; - keyPath = keyPath.Replace("HKLM\\", ""); - } - else if (keyPath.ToUpper().StartsWith("HKCC\\")) - { - hive = "HKCC"; - keyPath = keyPath.Replace("HKCC\\", ""); - } - else if (keyPath.ToUpper().StartsWith("HKCU\\")) - { - hive = "HKCU"; - keyPath = keyPath.Replace("HKCU\\", ""); - } - else - { - Console.WriteLine("Invalid regkey. Unable to determin hive. regkey must start with either: [HKLM], [HKCU], or [HKCC]"); - return false; - } - keyPathArray = keyPath.Split(new string[] { "\\" }, StringSplitOptions.None); - - try - { - regValueKind = (RegistryValueKind)System.Enum.Parse(typeof(RegistryValueKind), datatype); - } - catch (Exception ex) - { - Console.WriteLine("Invalid datatype. It must be: String, DWord, or QWord (case sensitive)"); - Console.WriteLine(ex.Message); - return false; - } - } - return true; - } - } - - /// - /// Task class that will delete a registry key value or registry key and all of its children - /// - public class RegistryDeleterTask : Task - { - private string hive; - private string keyPath; - private string[] keyPathArray; - private string name; - - public RegistryDeleterTask(string Data) : base(Data) { } - - public override void RunTask() - { - if (parseRegKeyName(System.Environment.ExpandEnvironmentVariables(data))) - { - try - { - RegistryKey rk = Registry.LocalMachine; - - if (hive == "HKCU") rk = Microsoft.Win32.Registry.CurrentUser; - if (hive == "HKCC") rk = Microsoft.Win32.Registry.CurrentConfig; - if (hive == "HKLM") rk = Microsoft.Win32.Registry.LocalMachine; - - RegistryKey rkParent = null; - foreach (string key in keyPathArray) - { - rkParent = rk; - rk = rk.OpenSubKey(key, true); - } - - if (String.IsNullOrEmpty(name)) - { - // delete the key and all of its children - string subkeyToDelete = keyPathArray[keyPathArray.Length - 1]; - rkParent.DeleteSubKeyTree(subkeyToDelete); - Console.WriteLine("Deleted registry key: '{0}'", hive + "\\" + keyPath); - } - else - { - // just delete this value - rk.DeleteValue(name); - Console.WriteLine("Deleted registry key: '{0}' name: '{1}'", hive + "\\" + keyPath, name); - } - } - catch (Exception ex) - { - Console.WriteLine("Unable to delete registry key: '{0}'", hive + "\\" + keyPath); - Console.WriteLine(ex.Message); - } - } - else - { - Console.WriteLine("Unable to delete registry key."); - } - - } - - private bool parseRegKeyName(string delimittedData) - { - string[] splitString = delimittedData.Split(new string[] { "," }, StringSplitOptions.None); - - if (splitString.Length > 2) - { - Console.WriteLine("Unable to parse registry key and name."); - return false; - } - - keyPath = splitString[0]; - if (splitString.Length == 2) - { - name = splitString[1]; - } - - if (keyPath.ToUpper().StartsWith("HKLM\\")) - { - hive = "HKLM"; - keyPath = keyPath.Replace("HKLM\\", ""); - } - else if (keyPath.ToUpper().StartsWith("HKCC\\")) - { - hive = "HKCC"; - keyPath = keyPath.Replace("HKCC\\", ""); - } - else if (keyPath.ToUpper().StartsWith("HKCU\\")) - { - hive = "HKCU"; - keyPath = keyPath.Replace("HKCU\\", ""); - } - else - { - Console.WriteLine("Invalid regkey. Unable to determine hive. regkey must start with either: [HKLM], [HKCU], or [HKCC]"); - return false; - } - keyPathArray = keyPath.Split(new string[] { "\\" }, StringSplitOptions.None); - return true; - } - } - public class TaskParser { @@ -431,18 +163,23 @@ namespace TestExe t = new SleepRandomTask(args[i + 1]); tasks.Add(t); break; - case "/log": - t = new LogTask(args[i + 1], args); + case "/lf": + t = new LargeFileTask(args[i + 1]); tasks.Add(t); break; - case "/pinfo": - t = new ProcessInfoTask(args[i + 1]); + case "/log": + t = new LogTask(args[i + 1], args); tasks.Add(t); break; case "/fe": t = new FileExistsTask(args[i + 1]); tasks.Add(t); break; +#if NET35 + case "/pinfo": + t = new ProcessInfoTask(args[i + 1]); + tasks.Add(t); + break; case "/regw": t = new RegistryWriterTask(args[i + 1]); tasks.Add(t); @@ -451,6 +188,7 @@ namespace TestExe t = new RegistryDeleterTask(args[i + 1]); tasks.Add(t); break; +#endif default: Console.WriteLine("Error: Invalid switch specified."); diff --git a/src/TestExe/TestExe.csproj b/src/TestExe/TestExe.csproj index 933fa932..5a130422 100644 --- a/src/TestExe/TestExe.csproj +++ b/src/TestExe/TestExe.csproj @@ -3,15 +3,18 @@ - net35 + net35;netcoreapp3.1 TestExe TestExe Exe embedded win-x86 + false + true + Major - + \ No newline at end of file diff --git a/src/WixToolsetTest.BurnE2E/CacheTests.cs b/src/WixToolsetTest.BurnE2E/CacheTests.cs index f62b0874..e8d37aef 100644 --- a/src/WixToolsetTest.BurnE2E/CacheTests.cs +++ b/src/WixToolsetTest.BurnE2E/CacheTests.cs @@ -5,6 +5,7 @@ namespace WixToolsetTest.BurnE2E using System.Collections.Generic; using System.IO; using WixBuildTools.TestSupport; + using WixTestTools; using WixToolset.Mba.Core; using Xunit; using Xunit.Abstractions; @@ -13,6 +14,32 @@ namespace WixToolsetTest.BurnE2E { public CacheTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + [Fact] + public void CanCache5GBFile() + { + var packageA = this.CreatePackageInstaller("PackageA"); + var bundleC = this.CreateBundleInstaller("BundleC"); + + packageA.VerifyInstalled(false); + + // Recreate the 5GB payload to avoid having to copy it to the VM to run the tests. + var targetFilePath = Path.Combine(this.TestContext.TestDataFolder, "fivegb.file"); + if (!File.Exists(targetFilePath)) + { + var testTool = new TestTool(Path.Combine(TestData.Get(), "win-x86", "TestExe.exe")) + { + Arguments = "/lf \"" + targetFilePath + "|5368709120\"", + ExpectedExitCode = 0, + }; + testTool.Run(true); + } + + bundleC.Install(); + bundleC.VerifyRegisteredAndInPackageCache(); + + packageA.VerifyInstalled(true); + } + [Fact] public void CanDownloadPayloadsFromMissingAttachedContainer() { -- cgit v1.2.3-55-g6feb