From 95e8b1be902cce3b5a394066a62e0c32d0688261 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 15 Sep 2022 12:17:07 -0500 Subject: 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. --- .../WixToolsetTest.BurnE2E/UpdateBundleTests.cs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/test/burn/WixToolsetTest.BurnE2E/UpdateBundleTests.cs') 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 packageBv1.VerifyInstalled(false); packageBv2.VerifyInstalled(false); } + + // Installs bundle Bv1.0 then attempts an update to bundle Bv2.0 during modify (server exists, v2.0 feed with wrong hash). + [RuntimeFact] + public void CanBlockWrongUpdateBundleFromDownloadInsteadOfModify() + { + var packageBv1 = this.CreatePackageInstaller("PackageBv1"); + var packageBv2 = this.CreatePackageInstaller("PackageBv2"); + var bundleBv1 = this.CreateBundleInstaller("BundleBv1"); + var bundleBv2 = this.CreateBundleInstaller("BundleBv2"); + var webServer = this.CreateWebServer(); + + webServer.AddFiles(new Dictionary + { + { "/BundleB/feed", Path.Combine(this.TestContext.TestDataFolder, "FeedBv2.0_wronghash.xml") }, + { "/BundleB/2.0/BundleB.exe", bundleBv2.Bundle }, + }); + webServer.Start(); + + packageBv1.VerifyInstalled(false); + packageBv2.VerifyInstalled(false); + + bundleBv1.Install(); + bundleBv1.VerifyRegisteredAndInPackageCache(); + + packageBv1.VerifyInstalled(true); + packageBv2.VerifyInstalled(false); + + // Run the v1 bundle requesting an update bundle. + bundleBv1.Modify(unchecked((int)0x80091007), arguments: "-checkupdate"); + + bundleBv1.VerifyRegisteredAndInPackageCache(); + bundleBv2.VerifyUnregisteredAndRemovedFromPackageCache(); + + packageBv1.VerifyInstalled(true); + packageBv2.VerifyInstalled(false); + } } } -- cgit v1.2.3-55-g6feb