diff options
Diffstat (limited to 'src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs')
-rw-r--r-- | src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs new file mode 100644 index 00000000..ced2e08e --- /dev/null +++ b/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs | |||
@@ -0,0 +1,76 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolsetTest.BurnE2E | ||
4 | { | ||
5 | using System; | ||
6 | using System.IO; | ||
7 | using Xunit; | ||
8 | using Xunit.Abstractions; | ||
9 | |||
10 | public class PrereqBaTests : BurnE2ETests | ||
11 | { | ||
12 | public PrereqBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | ||
13 | |||
14 | /// <summary> | ||
15 | /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist, | ||
16 | /// with an MSI package to represent the prerequisite package. | ||
17 | /// This verifies that: | ||
18 | /// The preqba doesn't infinitely reload itself after failing to load the managed BA. | ||
19 | /// The engine automatically uninstalls the bundle since only permanent packages were installed. | ||
20 | /// </summary> | ||
21 | [Fact] | ||
22 | public void DncPreqBaDetectsInfiniteLoop() | ||
23 | { | ||
24 | var packageA = this.CreatePackageInstaller("PackageA"); | ||
25 | this.CreatePackageInstaller("PackageF"); | ||
26 | |||
27 | var bundleA = this.CreateBundleInstaller("BundleA"); | ||
28 | |||
29 | var packageASourceCodeInstalled = packageA.GetInstalledFilePath("Package.wxs"); | ||
30 | |||
31 | // Source file should *not* be installed | ||
32 | Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}"); | ||
33 | |||
34 | bundleA.Install(); | ||
35 | |||
36 | // Part of the test is Install actually completing. | ||
37 | |||
38 | // Source file should be installed | ||
39 | Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled)); | ||
40 | |||
41 | // No non-permanent packages should have ended up installed or cached so it should have unregistered. | ||
42 | bundleA.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
43 | } | ||
44 | |||
45 | /// <summary> | ||
46 | /// This bundle purposely provides a WixToolset.Mba.Host.config file that requires a version of .NET Framework that doesn't exist, | ||
47 | /// with an MSI package to represent the prerequisite package. | ||
48 | /// This verifies that: | ||
49 | /// The preqba doesn't infinitely reload itself after failing to load the managed BA. | ||
50 | /// The engine automatically uninstalls the bundle since only permanent packages were installed. | ||
51 | /// </summary> | ||
52 | [Fact] | ||
53 | public void MbaPreqBaDetectsInfiniteLoop() | ||
54 | { | ||
55 | var packageB = this.CreatePackageInstaller("PackageB"); | ||
56 | this.CreatePackageInstaller("PackageF"); | ||
57 | |||
58 | var bundleB = this.CreateBundleInstaller("BundleB"); | ||
59 | |||
60 | var packageBSourceCodeInstalled = packageB.GetInstalledFilePath("Package.wxs"); | ||
61 | |||
62 | // Source file should *not* be installed | ||
63 | Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}"); | ||
64 | |||
65 | bundleB.Install(); | ||
66 | |||
67 | // Part of the test is Install actually completing. | ||
68 | |||
69 | // Source file should be installed | ||
70 | Assert.True(File.Exists(packageBSourceCodeInstalled), String.Concat("Should have found Package B payload installed at: ", packageBSourceCodeInstalled)); | ||
71 | |||
72 | // No non-permanent packages should have ended up installed or cached so it should have unregistered. | ||
73 | bundleB.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
74 | } | ||
75 | } | ||
76 | } | ||