diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-09-15 12:17:07 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-09-15 14:14:04 -0500 |
commit | 95e8b1be902cce3b5a394066a62e0c32d0688261 (patch) | |
tree | 955b165715e275b70033cf7cd4c956d71d365d21 /src/test | |
parent | ca3bf7968865be1cb80e9d63e7cc177f92469e2f (diff) | |
download | wix-95e8b1be902cce3b5a394066a62e0c32d0688261.tar.gz wix-95e8b1be902cce3b5a394066a62e0c32d0688261.tar.bz2 wix-95e8b1be902cce3b5a394066a62e0c32d0688261.zip |
Add more burn E2E tests.
Fix bug where first splash screen wasn't closed.
Fix bug where billboard only started the first time.
Fix bug where the restart status was lost when the exit code was an error.
Fix bug where the hash byte array length was compared to the hash string length (string is twice as long).
Fix bug where Burn didn't give update hash if the first byte was 0.
Diffstat (limited to 'src/test')
9 files changed, 186 insertions, 3 deletions
diff --git a/src/test/burn/TestData/ExePackageTests/CustomExitCodeExePackage/CustomExitCodeExePackage.wixproj b/src/test/burn/TestData/ExePackageTests/CustomExitCodeExePackage/CustomExitCodeExePackage.wixproj new file mode 100644 index 00000000..403f3320 --- /dev/null +++ b/src/test/burn/TestData/ExePackageTests/CustomExitCodeExePackage/CustomExitCodeExePackage.wixproj | |||
@@ -0,0 +1,17 @@ | |||
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 | <Project Sdk="WixToolset.Sdk"> | ||
3 | <PropertyGroup> | ||
4 | <OutputType>Bundle</OutputType> | ||
5 | <UpgradeCode>{9BB4F6D3-4EE3-40BF-879F-90E78440EAE8}</UpgradeCode> | ||
6 | </PropertyGroup> | ||
7 | <ItemGroup> | ||
8 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> | ||
9 | </ItemGroup> | ||
10 | <ItemGroup> | ||
11 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | ||
12 | </ItemGroup> | ||
13 | <ItemGroup> | ||
14 | <PackageReference Include="WixToolset.Bal.wixext" /> | ||
15 | <PackageReference Include="WixToolset.NetFx.wixext" /> | ||
16 | </ItemGroup> | ||
17 | </Project> \ No newline at end of file | ||
diff --git a/src/test/burn/TestData/ExePackageTests/CustomExitCodeExePackage/CustomExitCodeExePackage.wxs b/src/test/burn/TestData/ExePackageTests/CustomExitCodeExePackage/CustomExitCodeExePackage.wxs new file mode 100644 index 00000000..a02e48d1 --- /dev/null +++ b/src/test/burn/TestData/ExePackageTests/CustomExitCodeExePackage/CustomExitCodeExePackage.wxs | |||
@@ -0,0 +1,34 @@ | |||
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 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
4 | <Fragment> | ||
5 | <PackageGroup Id="BundlePackages"> | ||
6 | <ExePackage Id="TestExe" Cache="remove" PerMachine="yes" | ||
7 | DetectCondition="" Permanent="yes" InstallArguments="/ec [EXEEXITCODE]"> | ||
8 | <PayloadGroupRef Id="TestExePayloads" /> | ||
9 | |||
10 | <ExitCode Value="0" Behavior="error" /> | ||
11 | <ExitCode Value="3" Behavior="scheduleReboot" /> | ||
12 | <ExitCode Value="4" Behavior="forceReboot" /> | ||
13 | <ExitCode Value="5" Behavior="errorScheduleReboot" /> | ||
14 | <ExitCode Value="-2147024891" Behavior="errorScheduleReboot" /> | ||
15 | <ExitCode Value="6" Behavior="errorForceReboot" /> | ||
16 | <ExitCode Value="-2147024890" Behavior="errorForceReboot" /> | ||
17 | <ExitCode Value="3010" Behavior="error" /> | ||
18 | <ExitCode Value="-2147021886" Behavior="error" /> | ||
19 | <ExitCode Value="3011" Behavior="error" /> | ||
20 | <ExitCode Value="-2147021885" Behavior="error" /> | ||
21 | <ExitCode Value="1641" Behavior="error" /> | ||
22 | <ExitCode Value="-2147023255" Behavior="error" /> | ||
23 | <ExitCode Value="3017" Behavior="error" /> | ||
24 | <ExitCode Value="-2147021879" Behavior="error" /> | ||
25 | <ExitCode Value="3018" Behavior="error" /> | ||
26 | <ExitCode Value="-2147021878" Behavior="error" /> | ||
27 | <ExitCode Value="-2147483647" Behavior="error" /> | ||
28 | <ExitCode Value="-2147483648" Behavior="error" /> | ||
29 | <ExitCode Behavior="success" /> | ||
30 | </ExePackage> | ||
31 | </PackageGroup> | ||
32 | <Variable Name="EXEEXITCODE" bal:Overridable="yes" Value="1" /> | ||
33 | </Fragment> | ||
34 | </Wix> | ||
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml b/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml index 4c117506..c890d7df 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml | |||
@@ -132,7 +132,7 @@ There are currently four states for a button: default, focus, hover, and selecte | |||
132 | </Page> | 132 | </Page> |
133 | <Page Name="Billboard"> | 133 | <Page Name="Billboard"> |
134 | <Label X="6" Y="6" Width="-6" Height="43" FontId="Default"> | 134 | <Label X="6" Y="6" Width="-6" Height="43" FontId="Default"> |
135 | This page has a billboard. It loops between two panels every 1.5 seconds. | 135 | This page has a billboard. It loops between two panels every 1.5 seconds. Press Back to go to another page, and then come back and make sure it still loops. |
136 | </Label> | 136 | </Label> |
137 | <Billboard Name="FirstBillboard" X="11" Y="59" Width="-11" Height="-39" Interval="1500" Loop="yes"> | 137 | <Billboard Name="FirstBillboard" X="11" Y="59" Width="-11" Height="-39" Interval="1500" Loop="yes"> |
138 | <Panel> | 138 | <Panel> |
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingThemeLoose.xml b/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingThemeLoose.xml index b2b0dcb3..37757e64 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingThemeLoose.xml +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingThemeLoose.xml | |||
@@ -132,7 +132,7 @@ There are currently four states for a button: default, focus, hover, and selecte | |||
132 | </Page> | 132 | </Page> |
133 | <Page Name="Billboard"> | 133 | <Page Name="Billboard"> |
134 | <Label X="6" Y="6" Width="-6" Height="43" FontId="Default"> | 134 | <Label X="6" Y="6" Width="-6" Height="43" FontId="Default"> |
135 | This page has a billboard. It loops between two panels every 1.5 seconds. | 135 | This page has a billboard. It loops between two panels every 1.5 seconds. Press Back to go to another page, and then come back and make sure it still loops. |
136 | </Label> | 136 | </Label> |
137 | <Billboard Name="FirstBillboard" X="11" Y="59" Width="-11" Height="-39" Interval="1500" Loop="yes"> | 137 | <Billboard Name="FirstBillboard" X="11" Y="59" Width="-11" Height="-39" Interval="1500" Loop="yes"> |
138 | <Panel> | 138 | <Panel> |
diff --git a/src/test/burn/TestData/Manual/BundleA/ManualTests.txt b/src/test/burn/TestData/Manual/BundleA/ManualTests.txt index b8c6e74d..351f2c1f 100644 --- a/src/test/burn/TestData/Manual/BundleA/ManualTests.txt +++ b/src/test/burn/TestData/Manual/BundleA/ManualTests.txt | |||
@@ -152,3 +152,13 @@ CanRestartFromUnelevatedPerUserBundleWithShutdownPrivilege | |||
152 | ======================================= | 152 | ======================================= |
153 | 153 | ||
154 | (10. Uninstall the bundle) | 154 | (10. Uninstall the bundle) |
155 | |||
156 | CanShowSplashScreenQuicklyAndCacheThousandsOfFilesInLinearTime | ||
157 | |||
158 | 1. Run BundleB.exe. | ||
159 | 2. The splash screen should come up immediately (less than 1 second). | ||
160 | 3. After the wixstdba UI comes up, make sure the splash screen was closed (it might be hiding underneath windows). | ||
161 | 4. Click Install (accept elevation). | ||
162 | 5. This bundle contains 10000 loose files which needs to be cached, which used to take over 30 minutes. The exact timing can be different on different machines, but it should be closer to 30 seconds. | ||
163 | 6. Click Close. | ||
164 | (7. Uninstall the bundle) | ||
diff --git a/src/test/burn/TestData/UpdateBundleTests/BundleBv1/FeedBv2.0_wronghash.xml b/src/test/burn/TestData/UpdateBundleTests/BundleBv1/FeedBv2.0_wronghash.xml new file mode 100644 index 00000000..82ce6837 --- /dev/null +++ b/src/test/burn/TestData/UpdateBundleTests/BundleBv1/FeedBv2.0_wronghash.xml | |||
@@ -0,0 +1,54 @@ | |||
1 | <?xml version='1.0' ?> | ||
2 | <!-- 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. --> | ||
3 | |||
4 | |||
5 | <feed xmlns="http://www.w3.org/2005/Atom" xmlns:as="http://appsyndication.org/2006/appsyn"> | ||
6 | <title type="text">BundleB v2.0</title> | ||
7 | <subtitle type="text">Bundle Subtitle.</subtitle> | ||
8 | <as:application type="application/exe">1116353B-7C6E-4C29-BFA1-D4A972CD421D</as:application> | ||
9 | <updated>2014-07-14T12:39:00.000Z</updated> | ||
10 | <id>http://localhost:9999/e2e/BundleB/feed</id> | ||
11 | <link rel="self" type="application/atom+xml" href="http://localhost:9999/e2e/BundleB/feed"/> | ||
12 | <generator version="0.1">manual build</generator> | ||
13 | <entry> | ||
14 | <title>Bundle v2.0</title> | ||
15 | <id>v2.0</id> | ||
16 | <author> | ||
17 | <name>Bundle_Author</name> | ||
18 | <uri>http://mycompany.com/software</uri> | ||
19 | <email>Bundle_Author@mycompany.com</email> | ||
20 | </author> | ||
21 | <link rel="alternate" href="http://www.mycompany.com/content/view/software"/> | ||
22 | <link rel="enclosure" href="http://localhost:9999/e2e/BundleB/2.0/BundleB.exe" length="0" type="application/octet-stream"> | ||
23 | <as:name>this hash is supposed to be wrong but has a tiny chance of actually being right</as:name> | ||
24 | <as:digest algorithm="sha512">00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</as:digest> | ||
25 | </link> | ||
26 | <content type="html"> | ||
27 | <p>Change list:</p><ul> | ||
28 | <li>Updated release.</li> | ||
29 | </ul> | ||
30 | </content> | ||
31 | <as:upgrade version="1.0" /> | ||
32 | <as:version>2.0.0.0</as:version> | ||
33 | <updated>2014-11-10T12:39:00.000Z</updated> | ||
34 | </entry> | ||
35 | <entry> | ||
36 | <title>Bundle v1.0</title> | ||
37 | <id>v1.0</id> | ||
38 | <author> | ||
39 | <name>Bundle_Author</name> | ||
40 | <uri>http://mycompany.com/software</uri> | ||
41 | <email>Bundle_Author@mycompany.com</email> | ||
42 | </author> | ||
43 | <link rel="alternate" href="http://www.mycompany.com/content/view/software"/> | ||
44 | <link rel="enclosure" href="http://localhost:9999/e2e/BundleB/1.0/BundleB.exe" length="0" type="application/octet-stream"/> | ||
45 | <content type="html"> | ||
46 | <p>Change list:</p><ul> | ||
47 | <li>Initial release.</li> | ||
48 | </ul> | ||
49 | </content> | ||
50 | <as:upgrade version="1.0.0.0-preview" /> | ||
51 | <as:version>1.0.0.0</as:version> | ||
52 | <updated>2014-11-09T12:39:00.000Z</updated> | ||
53 | </entry> | ||
54 | </feed> | ||
diff --git a/src/test/burn/WixTestTools/MSIExec.cs b/src/test/burn/WixTestTools/MSIExec.cs index 5f57da7b..a905ec5a 100644 --- a/src/test/burn/WixTestTools/MSIExec.cs +++ b/src/test/burn/WixTestTools/MSIExec.cs | |||
@@ -666,7 +666,13 @@ namespace WixTestTools | |||
666 | /// A restart is required to complete the install. This message is indicative of a success. | 666 | /// A restart is required to complete the install. This message is indicative of a success. |
667 | /// This does not include installs where the ForceReboot action is run. | 667 | /// This does not include installs where the ForceReboot action is run. |
668 | /// </summary> | 668 | /// </summary> |
669 | ERROR_SUCCESS_REBOOT_REQUIRED = 3010 | 669 | ERROR_SUCCESS_REBOOT_REQUIRED = 3010, |
670 | |||
671 | /// <summary> | ||
672 | /// ERROR_SUCCESS_REBOOT_REQUIRED 3017 | ||
673 | /// The requested operation failed. A system reboot is required to roll back changes made. | ||
674 | /// </summary> | ||
675 | ERROR_FAIL_REBOOT_REQUIRED = 3017, | ||
670 | } | 676 | } |
671 | 677 | ||
672 | /// <summary> | 678 | /// <summary> |
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs index e76461f3..42301f30 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/ExePackageTests.cs | |||
@@ -143,6 +143,32 @@ namespace WixToolsetTest.BurnE2E | |||
143 | } | 143 | } |
144 | 144 | ||
145 | [RuntimeFact] | 145 | [RuntimeFact] |
146 | public void CanUseLargeCustomExitCode() | ||
147 | { | ||
148 | var customExitCodeExePackageBundle = this.CreateBundleInstaller(@"CustomExitCodeExePackage"); | ||
149 | |||
150 | var installLogPath = customExitCodeExePackageBundle.Install(5, "EXEEXITCODE=-2147024891"); | ||
151 | customExitCodeExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
152 | |||
153 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, "TestExe.exe\" /ec -2147024891")); | ||
154 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, "The process for package: TestExe exited with code: 0x80070005. The exit code has been translated to type: ErrorScheduleReboot and restart: Required.")); | ||
155 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, "Applied execute package: TestExe, result: 0x80070005, restart: Required")); | ||
156 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, "Apply complete, result: 0x80070005, restart: Required, ba requested restart: No")); | ||
157 | } | ||
158 | |||
159 | [RuntimeFact] | ||
160 | public void CanUseWildcardCustomExitCode() | ||
161 | { | ||
162 | var customExitCodeExePackageBundle = this.CreateBundleInstaller(@"CustomExitCodeExePackage"); | ||
163 | |||
164 | var installLogPath = customExitCodeExePackageBundle.Install((int)MSIExec.MSIExecReturnCode.SUCCESS, "EXEEXITCODE=1"); | ||
165 | customExitCodeExePackageBundle.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
166 | |||
167 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, "TestExe.exe\" /ec 1")); | ||
168 | Assert.True(LogVerifier.MessageInLogFile(installLogPath, "The process for package: TestExe exited with code: 0x1. The exit code has been translated to type: Success and restart: None.")); | ||
169 | } | ||
170 | |||
171 | [RuntimeFact] | ||
146 | public void CanInstallAndUninstallPerUserArpEntryExePackage() | 172 | public void CanInstallAndUninstallPerUserArpEntryExePackage() |
147 | { | 173 | { |
148 | var perUserArpEntryExePackageBundle = this.CreateBundleInstaller(@"PerUserArpEntryExePackage"); | 174 | var perUserArpEntryExePackageBundle = this.CreateBundleInstaller(@"PerUserArpEntryExePackage"); |
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/UpdateBundleTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/UpdateBundleTests.cs index df666833..f7ec8647 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/UpdateBundleTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/UpdateBundleTests.cs | |||
@@ -242,5 +242,41 @@ namespace WixToolsetTest.BurnE2E | |||
242 | packageBv1.VerifyInstalled(false); | 242 | packageBv1.VerifyInstalled(false); |
243 | packageBv2.VerifyInstalled(false); | 243 | packageBv2.VerifyInstalled(false); |
244 | } | 244 | } |
245 | |||
246 | // Installs bundle Bv1.0 then attempts an update to bundle Bv2.0 during modify (server exists, v2.0 feed with wrong hash). | ||
247 | [RuntimeFact] | ||
248 | public void CanBlockWrongUpdateBundleFromDownloadInsteadOfModify() | ||
249 | { | ||
250 | var packageBv1 = this.CreatePackageInstaller("PackageBv1"); | ||
251 | var packageBv2 = this.CreatePackageInstaller("PackageBv2"); | ||
252 | var bundleBv1 = this.CreateBundleInstaller("BundleBv1"); | ||
253 | var bundleBv2 = this.CreateBundleInstaller("BundleBv2"); | ||
254 | var webServer = this.CreateWebServer(); | ||
255 | |||
256 | webServer.AddFiles(new Dictionary<string, string> | ||
257 | { | ||
258 | { "/BundleB/feed", Path.Combine(this.TestContext.TestDataFolder, "FeedBv2.0_wronghash.xml") }, | ||
259 | { "/BundleB/2.0/BundleB.exe", bundleBv2.Bundle }, | ||
260 | }); | ||
261 | webServer.Start(); | ||
262 | |||
263 | packageBv1.VerifyInstalled(false); | ||
264 | packageBv2.VerifyInstalled(false); | ||
265 | |||
266 | bundleBv1.Install(); | ||
267 | bundleBv1.VerifyRegisteredAndInPackageCache(); | ||
268 | |||
269 | packageBv1.VerifyInstalled(true); | ||
270 | packageBv2.VerifyInstalled(false); | ||
271 | |||
272 | // Run the v1 bundle requesting an update bundle. | ||
273 | bundleBv1.Modify(unchecked((int)0x80091007), arguments: "-checkupdate"); | ||
274 | |||
275 | bundleBv1.VerifyRegisteredAndInPackageCache(); | ||
276 | bundleBv2.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
277 | |||
278 | packageBv1.VerifyInstalled(true); | ||
279 | packageBv2.VerifyInstalled(false); | ||
280 | } | ||
245 | } | 281 | } |
246 | } | 282 | } |