diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-21 16:51:22 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-21 16:54:42 -0500 |
| commit | 0531df3e9f7b3e41434def0c569bd748adc721f6 (patch) | |
| tree | ec8003985cac685aee6c1ece1e0a2a05907f640e /src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |
| parent | aee568fddd21fe0fc270f7e705dc7b9e834d9ff4 (diff) | |
| download | wix-0531df3e9f7b3e41434def0c569bd748adc721f6.tar.gz wix-0531df3e9f7b3e41434def0c569bd748adc721f6.tar.bz2 wix-0531df3e9f7b3e41434def0c569bd748adc721f6.zip | |
Detect payload collisions.
#4574
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index d121da0f..cc91d212 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
| @@ -10,6 +10,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 10 | using System.Xml; | 10 | using System.Xml; |
| 11 | using Example.Extension; | 11 | using Example.Extension; |
| 12 | using WixBuildTools.TestSupport; | 12 | using WixBuildTools.TestSupport; |
| 13 | using WixToolset.Core.Burn; | ||
| 13 | using WixToolset.Core.TestPackage; | 14 | using WixToolset.Core.TestPackage; |
| 14 | using WixToolset.Data; | 15 | using WixToolset.Data; |
| 15 | using WixToolset.Data.Burn; | 16 | using WixToolset.Data.Burn; |
| @@ -306,7 +307,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 306 | } | 307 | } |
| 307 | } | 308 | } |
| 308 | 309 | ||
| 309 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/4574")] | 310 | [Fact] |
| 310 | public void CantBuildWithDuplicatePayloadNames() | 311 | public void CantBuildWithDuplicatePayloadNames() |
| 311 | { | 312 | { |
| 312 | var folder = TestData.Get(@"TestData"); | 313 | var folder = TestData.Get(@"TestData"); |
| @@ -328,7 +329,42 @@ namespace WixToolsetTest.CoreIntegration | |||
| 328 | "-o", exePath, | 329 | "-o", exePath, |
| 329 | }); | 330 | }); |
| 330 | 331 | ||
| 331 | Assert.InRange(result.ExitCode, 2, Int32.MaxValue); | 332 | var attachedContainerWarnings = result.Messages.Where(m => m.Id == (int)BurnBackendWarnings.Ids.AttachedContainerPayloadCollision) |
| 333 | .Select(m => m.ToString()) | ||
| 334 | .ToArray(); | ||
| 335 | WixAssert.CompareLineByLine(new string[] | ||
| 336 | { | ||
| 337 | "The Payload 'Auto2' has a duplicate Name 'burn.exe' in the attached container. When extracting the bundle with dark.exe, the file will get overwritten.", | ||
| 338 | }, attachedContainerWarnings); | ||
| 339 | |||
| 340 | var baContainerErrors = result.Messages.Where(m => m.Id == (int)BurnBackendErrors.Ids.BAContainerPayloadCollision) | ||
| 341 | .Select(m => m.ToString()) | ||
| 342 | .ToArray(); | ||
| 343 | WixAssert.CompareLineByLine(new string[] | ||
| 344 | { | ||
| 345 | "The Payload 'DuplicatePayloadNames.wxs' has a duplicate Name 'fakeba.dll' in the BA container. When extracting the container at runtime, the file will get overwritten.", | ||
| 346 | "The Payload 'uxTxMXPVMXwQrPTMIGa5WGt93w0Ns' has a duplicate Name 'BootstrapperApplicationData.xml' in the BA container. When extracting the container at runtime, the file will get overwritten.", | ||
| 347 | "The Payload 'uxYRbgitOs0K878jn5L_z7LdJ21KI' has a duplicate Name 'BundleExtensionData.xml' in the BA container. When extracting the container at runtime, the file will get overwritten.", | ||
| 348 | }, baContainerErrors); | ||
| 349 | |||
| 350 | var externalErrors = result.Messages.Where(m => m.Id == (int)BurnBackendErrors.Ids.ExternalPayloadCollision) | ||
| 351 | .Select(m => m.ToString()) | ||
| 352 | .ToArray(); | ||
| 353 | WixAssert.CompareLineByLine(new string[] | ||
| 354 | { | ||
| 355 | "The external Payload 'HiddenPersistedBundleVariable.wxs' has a duplicate Name 'PayloadCollision'. When building the bundle or laying out the bundle, the file will get overwritten.", | ||
| 356 | "The external Container 'MsiPackagesContainer' has a duplicate Name 'ContainerCollision'. When building the bundle or laying out the bundle, the file will get overwritten.", | ||
| 357 | }, externalErrors); | ||
| 358 | |||
| 359 | var packageCacheErrors = result.Messages.Where(m => m.Id == (int)BurnBackendErrors.Ids.PackageCachePayloadCollision) | ||
| 360 | .Select(m => m.ToString()) | ||
| 361 | .ToArray(); | ||
| 362 | WixAssert.CompareLineByLine(new string[] | ||
| 363 | { | ||
| 364 | "The Payload 'test.msi' has a duplicate Name 'test.msi' in package 'test.msi'. When caching the package, the file will get overwritten.", | ||
| 365 | }, packageCacheErrors); | ||
| 366 | |||
| 367 | Assert.Equal(14, result.Messages.Length); | ||
| 332 | } | 368 | } |
| 333 | } | 369 | } |
| 334 | 370 | ||
