summaryrefslogtreecommitdiff
path: root/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs')
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs225
1 files changed, 221 insertions, 4 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
index 52e165b4..d958b454 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
@@ -18,6 +18,39 @@ namespace WixToolsetTest.BurnE2E
18 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist, 18 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist,
19 /// with an MSI package to represent the prerequisite package. 19 /// with an MSI package to represent the prerequisite package.
20 /// This verifies that: 20 /// This verifies that:
21 /// The preqba doesn't infinitely try to install prereqs.
22 /// The engine automatically uninstalls the bundle since only permanent packages were installed.
23 /// </summary>
24 [RuntimeFact]
25 public void DncAlwaysPreqBaDetectsInfiniteLoop()
26 {
27 var packageA = this.CreatePackageInstaller("PackageA");
28 var packageC = this.CreatePackageInstaller("PackageC");
29
30 var bundleC = this.CreateBundleInstaller("BundleC");
31
32 var packageASourceCodeInstalled = packageA.GetInstalledFilePath("Package.wxs");
33
34 // Source file should *not* be installed
35 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
36 packageC.VerifyInstalled(false);
37
38 bundleC.Install(E_PREREQBA_INFINITE_LOOP, "CAUSEINFINITELOOP=1");
39
40 // Part of the test is Install actually completing.
41
42 // Source file should be installed
43 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
44 packageC.VerifyInstalled(false);
45
46 // No non-permanent packages should have ended up installed or cached so it should have unregistered.
47 bundleC.VerifyUnregisteredAndRemovedFromPackageCache();
48 }
49
50 /// <summary>
51 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist,
52 /// with an MSI package to represent the prerequisite package.
53 /// This verifies that:
21 /// The preqba doesn't infinitely reload itself after failing to load the managed BA. 54 /// The preqba doesn't infinitely reload itself after failing to load the managed BA.
22 /// The engine automatically uninstalls the bundle since only permanent packages were installed. 55 /// The engine automatically uninstalls the bundle since only permanent packages were installed.
23 /// </summary> 56 /// </summary>
@@ -25,7 +58,7 @@ namespace WixToolsetTest.BurnE2E
25 public void DncPreqBaDetectsInfiniteLoop() 58 public void DncPreqBaDetectsInfiniteLoop()
26 { 59 {
27 var packageA = this.CreatePackageInstaller("PackageA"); 60 var packageA = this.CreatePackageInstaller("PackageA");
28 this.CreatePackageInstaller("PackageF"); 61 var packageC = this.CreatePackageInstaller("PackageC");
29 62
30 var bundleA = this.CreateBundleInstaller("BundleA"); 63 var bundleA = this.CreateBundleInstaller("BundleA");
31 64
@@ -33,19 +66,132 @@ namespace WixToolsetTest.BurnE2E
33 66
34 // Source file should *not* be installed 67 // Source file should *not* be installed
35 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}"); 68 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
69 packageC.VerifyInstalled(false);
36 70
37 bundleA.Install(E_PREREQBA_INFINITE_LOOP); 71 bundleA.Install(E_PREREQBA_INFINITE_LOOP, "CAUSEINFINITELOOP=1");
38 72
39 // Part of the test is Install actually completing. 73 // Part of the test is Install actually completing.
40 74
41 // Source file should be installed 75 // Source file should be installed
42 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled)); 76 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
77 packageC.VerifyInstalled(false);
43 78
44 // No non-permanent packages should have ended up installed or cached so it should have unregistered. 79 // No non-permanent packages should have ended up installed or cached so it should have unregistered.
45 bundleA.VerifyUnregisteredAndRemovedFromPackageCache(); 80 bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
46 } 81 }
47 82
48 /// <summary> 83 /// <summary>
84 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist,
85 /// with an EXE prereq package to swap it out with a good one.
86 /// This verifies that:
87 /// The preqba doesn't infinitely try to install prereqs.
88 /// The managed BA gets loaded after installing prereqs.
89 /// </summary>
90 [RuntimeFact]
91 public void DncAlwaysPreqBaLoadsManagedBaAfterInstallingPrereqs()
92 {
93 var packageA = this.CreatePackageInstaller("PackageA");
94 var packageC = this.CreatePackageInstaller("PackageC");
95
96 var bundleC = this.CreateBundleInstaller("BundleC");
97
98 var packageASourceCodeInstalled = packageA.GetInstalledFilePath("Package.wxs");
99
100 // Source file should *not* be installed
101 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
102 packageC.VerifyInstalled(false);
103
104 bundleC.Install();
105
106 // Source file should be installed
107 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
108 packageC.VerifyInstalled(true);
109
110 bundleC.VerifyRegisteredAndInPackageCache();
111
112 bundleC.Uninstall();
113
114 bundleC.VerifyUnregisteredAndRemovedFromPackageCache();
115 }
116
117 /// <summary>
118 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist,
119 /// with an EXE prereq package to swap it out with a good one.
120 /// This verifies that:
121 /// The preqba doesn't infinitely reload itself after failing to load the managed BA.
122 /// The managed BA gets loaded after installing prereqs.
123 /// </summary>
124 [RuntimeFact]
125 public void DncPreqBaLoadsManagedBaAfterInstallingPrereqs()
126 {
127 var packageA = this.CreatePackageInstaller("PackageA");
128 var packageC = this.CreatePackageInstaller("PackageC");
129
130 var bundleA = this.CreateBundleInstaller("BundleA");
131
132 var packageASourceCodeInstalled = packageA.GetInstalledFilePath("Package.wxs");
133
134 // Source file should *not* be installed
135 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
136 packageC.VerifyInstalled(false);
137
138 bundleA.Install();
139
140 // Source file should be installed
141 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
142 packageC.VerifyInstalled(true);
143
144 bundleA.VerifyRegisteredAndInPackageCache();
145
146 bundleA.Uninstall();
147
148 bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
149 }
150
151 [RuntimeFact]
152 public void DncAlwaysPreqBaForwardsHelpToManagedBa()
153 {
154 var bundleE = this.CreateBundleInstaller("BundleE");
155
156 var bundleLog = bundleE.Help();
157
158 Assert.True(LogVerifier.MessageInLogFile(bundleLog, "This is a BA for automated testing"));
159 }
160
161 /// <summary>
162 /// This bundle purposely provides a WixToolset.Mba.Host.config file that requires a version of .NET Framework that doesn't exist,
163 /// with an MSI package to represent the prerequisite package.
164 /// This verifies that:
165 /// The preqba doesn't infinitely try to install prereqs.
166 /// The engine automatically uninstalls the bundle since only permanent packages were installed.
167 /// </summary>
168 [RuntimeFact]
169 public void MbaAlwaysPreqBaDetectsInfiniteLoop()
170 {
171 var packageB = this.CreatePackageInstaller("PackageB");
172 var packageC = this.CreatePackageInstaller("PackageC");
173
174 var bundleD = this.CreateBundleInstaller("BundleD");
175
176 var packageBSourceCodeInstalled = packageB.GetInstalledFilePath("Package.wxs");
177
178 // Source file should *not* be installed
179 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}");
180 packageC.VerifyInstalled(false);
181
182 bundleD.Install(E_PREREQBA_INFINITE_LOOP, "CAUSEINFINITELOOP=1");
183
184 // Part of the test is Install actually completing.
185
186 // Source file should be installed
187 Assert.True(File.Exists(packageBSourceCodeInstalled), String.Concat("Should have found Package B payload installed at: ", packageBSourceCodeInstalled));
188 packageC.VerifyInstalled(false);
189
190 // No non-permanent packages should have ended up installed or cached so it should have unregistered.
191 bundleD.VerifyUnregisteredAndRemovedFromPackageCache();
192 }
193
194 /// <summary>
49 /// This bundle purposely provides a WixToolset.Mba.Host.config file that requires a version of .NET Framework that doesn't exist, 195 /// This bundle purposely provides a WixToolset.Mba.Host.config file that requires a version of .NET Framework that doesn't exist,
50 /// with an MSI package to represent the prerequisite package. 196 /// with an MSI package to represent the prerequisite package.
51 /// This verifies that: 197 /// This verifies that:
@@ -56,7 +202,7 @@ namespace WixToolsetTest.BurnE2E
56 public void MbaPreqBaDetectsInfiniteLoop() 202 public void MbaPreqBaDetectsInfiniteLoop()
57 { 203 {
58 var packageB = this.CreatePackageInstaller("PackageB"); 204 var packageB = this.CreatePackageInstaller("PackageB");
59 this.CreatePackageInstaller("PackageF"); 205 var packageC = this.CreatePackageInstaller("PackageC");
60 206
61 var bundleB = this.CreateBundleInstaller("BundleB"); 207 var bundleB = this.CreateBundleInstaller("BundleB");
62 208
@@ -64,13 +210,84 @@ namespace WixToolsetTest.BurnE2E
64 210
65 // Source file should *not* be installed 211 // Source file should *not* be installed
66 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}"); 212 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}");
213 packageC.VerifyInstalled(false);
67 214
68 bundleB.Install(E_PREREQBA_INFINITE_LOOP); 215 bundleB.Install(E_PREREQBA_INFINITE_LOOP, "CAUSEINFINITELOOP=1");
69 216
70 // Part of the test is Install actually completing. 217 // Part of the test is Install actually completing.
71 218
72 // Source file should be installed 219 // Source file should be installed
73 Assert.True(File.Exists(packageBSourceCodeInstalled), String.Concat("Should have found Package B payload installed at: ", packageBSourceCodeInstalled)); 220 Assert.True(File.Exists(packageBSourceCodeInstalled), String.Concat("Should have found Package B payload installed at: ", packageBSourceCodeInstalled));
221 packageC.VerifyInstalled(false);
222
223 // No non-permanent packages should have ended up installed or cached so it should have unregistered.
224 bundleB.VerifyUnregisteredAndRemovedFromPackageCache();
225 }
226
227 /// <summary>
228 /// This bundle purposely provides a WixToolset.Mba.Host.config file that requires a version of .NET Framework that doesn't exist,
229 /// with an EXE prereq package to swap it out with a good one.
230 /// This verifies that:
231 /// The preqba doesn't infinitely try to install prereqs.
232 /// The managed BA gets loaded after installing prereqs.
233 /// </summary>
234 [RuntimeFact]
235 public void MbaAlwaysPreqBaLoadsManagedBaAfterInstallingPrereqs()
236 {
237 var packageB = this.CreatePackageInstaller("PackageB");
238 var packageC = this.CreatePackageInstaller("PackageC");
239
240 var bundleD = this.CreateBundleInstaller("BundleD");
241
242 var packageBSourceCodeInstalled = packageB.GetInstalledFilePath("Package.wxs");
243
244 // Source file should *not* be installed
245 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}");
246 packageC.VerifyInstalled(false);
247
248 bundleD.Install();
249
250 // Source file should be installed
251 Assert.True(File.Exists(packageBSourceCodeInstalled), String.Concat("Should have found Package B payload installed at: ", packageBSourceCodeInstalled));
252 packageC.VerifyInstalled(true);
253
254 bundleD.VerifyRegisteredAndInPackageCache();
255
256 bundleD.Uninstall();
257
258 bundleD.VerifyUnregisteredAndRemovedFromPackageCache();
259 }
260
261 /// <summary>
262 /// This bundle purposely provides a WixToolset.Mba.Host.config file that requires a version of .NET Framework that doesn't exist,
263 /// with an EXE prereq package to swap it out with a good one.
264 /// This verifies that:
265 /// The preqba doesn't infinitely reload itself after failing to load the managed BA.
266 /// The managed BA gets loaded after installing prereqs.
267 /// </summary>
268 [RuntimeFact]
269 public void MbaPreqBaLoadsManagedBaAfterInstallingPrereqs()
270 {
271 var packageB = this.CreatePackageInstaller("PackageB");
272 var packageC = this.CreatePackageInstaller("PackageC");
273
274 var bundleB = this.CreateBundleInstaller("BundleB");
275
276 var packageBSourceCodeInstalled = packageB.GetInstalledFilePath("Package.wxs");
277
278 // Source file should *not* be installed
279 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}");
280 packageC.VerifyInstalled(false);
281
282 bundleB.Install();
283
284 // Source file should be installed
285 Assert.True(File.Exists(packageBSourceCodeInstalled), String.Concat("Should have found Package B payload installed at: ", packageBSourceCodeInstalled));
286 packageC.VerifyInstalled(true);
287
288 bundleB.VerifyRegisteredAndInPackageCache();
289
290 bundleB.Uninstall();
74 291
75 // No non-permanent packages should have ended up installed or cached so it should have unregistered. 292 // No non-permanent packages should have ended up installed or cached so it should have unregistered.
76 bundleB.VerifyUnregisteredAndRemovedFromPackageCache(); 293 bundleB.VerifyUnregisteredAndRemovedFromPackageCache();