summaryrefslogtreecommitdiff
path: root/src/test/msi/WixToolsetTest.MsiE2E
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/msi/WixToolsetTest.MsiE2E')
-rw-r--r--src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs28
-rw-r--r--src/test/msi/WixToolsetTest.MsiE2E/MsiE2ETests.cs2
-rw-r--r--src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionUserTests.cs12
3 files changed, 7 insertions, 35 deletions
diff --git a/src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs b/src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs
deleted file mode 100644
index a7646568..00000000
--- a/src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs
+++ /dev/null
@@ -1,28 +0,0 @@
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
3namespace WixToolsetTest.MsiE2E
4{
5 using System;
6 using System.Security.Principal;
7
8 public class MsiE2EFixture
9 {
10 const string RequiredEnvironmentVariableName = "RuntimeTestsEnabled";
11
12 public MsiE2EFixture()
13 {
14 using var identity = WindowsIdentity.GetCurrent();
15 var principal = new WindowsPrincipal(identity);
16 if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
17 {
18 throw new InvalidOperationException("These tests must run elevated.");
19 }
20
21 var testsEnabledString = Environment.GetEnvironmentVariable(RequiredEnvironmentVariableName);
22 if (!bool.TryParse(testsEnabledString, out var testsEnabled) || !testsEnabled)
23 {
24 throw new InvalidOperationException($"These tests affect machine state. Set the {RequiredEnvironmentVariableName} environment variable to true to accept the consequences.");
25 }
26 }
27 }
28}
diff --git a/src/test/msi/WixToolsetTest.MsiE2E/MsiE2ETests.cs b/src/test/msi/WixToolsetTest.MsiE2E/MsiE2ETests.cs
index 22f2173b..ca7f15ed 100644
--- a/src/test/msi/WixToolsetTest.MsiE2E/MsiE2ETests.cs
+++ b/src/test/msi/WixToolsetTest.MsiE2E/MsiE2ETests.cs
@@ -38,7 +38,7 @@ namespace WixToolsetTest.MsiE2E
38 } 38 }
39 39
40 [CollectionDefinition("MsiE2E", DisableParallelization = true)] 40 [CollectionDefinition("MsiE2E", DisableParallelization = true)]
41 public class MsiE2ECollectionDefinition : ICollectionFixture<MsiE2EFixture> 41 public class MsiE2ECollectionDefinition
42 { 42 {
43 } 43 }
44} 44}
diff --git a/src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionUserTests.cs b/src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionUserTests.cs
index 21491858..fcdfde52 100644
--- a/src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionUserTests.cs
+++ b/src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionUserTests.cs
@@ -15,7 +15,7 @@ namespace WixToolsetTest.MsiE2E
15 const string TempUsername = "USERNAME"; 15 const string TempUsername = "USERNAME";
16 16
17 // Verify that the users specified in the authoring are created as expected. 17 // Verify that the users specified in the authoring are created as expected.
18 [Fact] 18 [RuntimeFact]
19 public void CanInstallAndUninstallUsers() 19 public void CanInstallAndUninstallUsers()
20 { 20 {
21 var arguments = new string[] 21 var arguments = new string[]
@@ -49,7 +49,7 @@ namespace WixToolsetTest.MsiE2E
49 } 49 }
50 50
51 // Verify the rollback action reverts all Users changes. 51 // Verify the rollback action reverts all Users changes.
52 [Fact] 52 [RuntimeFact]
53 public void CanRollbackUsers() 53 public void CanRollbackUsers()
54 { 54 {
55 var arguments = new string[] 55 var arguments = new string[]
@@ -74,7 +74,7 @@ namespace WixToolsetTest.MsiE2E
74 } 74 }
75 75
76 // Verify that the users specified in the authoring are created as expected on repair. 76 // Verify that the users specified in the authoring are created as expected on repair.
77 [Fact(Skip = "Test demonstrates failure")] 77 [RuntimeFact(Skip = "Test demonstrates failure")]
78 public void CanRepairUsers() 78 public void CanRepairUsers()
79 { 79 {
80 var arguments = new string[] 80 var arguments = new string[]
@@ -113,7 +113,7 @@ namespace WixToolsetTest.MsiE2E
113 } 113 }
114 114
115 // Verify that Installation fails if FailIfExisits is set. 115 // Verify that Installation fails if FailIfExisits is set.
116 [Fact] 116 [RuntimeFact]
117 public void FailsIfUserExists() 117 public void FailsIfUserExists()
118 { 118 {
119 var productFailIfExists = this.CreatePackageInstaller("ProductFailIfExists"); 119 var productFailIfExists = this.CreatePackageInstaller("ProductFailIfExists");
@@ -139,7 +139,7 @@ namespace WixToolsetTest.MsiE2E
139 } 139 }
140 140
141 // Verify that a user cannot be created on a domain on which you dont have create user permission. 141 // Verify that a user cannot be created on a domain on which you dont have create user permission.
142 [Fact] 142 [RuntimeFact]
143 public void FailsIfRestrictedDomain() 143 public void FailsIfRestrictedDomain()
144 { 144 {
145 var productRestrictedDomain = this.CreatePackageInstaller("ProductRestrictedDomain"); 145 var productRestrictedDomain = this.CreatePackageInstaller("ProductRestrictedDomain");
@@ -151,7 +151,7 @@ namespace WixToolsetTest.MsiE2E
151 } 151 }
152 152
153 // Verify that adding a user to a non-existent group does not fail the install when non-vital. 153 // Verify that adding a user to a non-existent group does not fail the install when non-vital.
154 [Fact] 154 [RuntimeFact]
155 public void IgnoresMissingGroupWhenNonVital() 155 public void IgnoresMissingGroupWhenNonVital()
156 { 156 {
157 var productNonVitalGroup = this.CreatePackageInstaller("ProductNonVitalUserGroup"); 157 var productNonVitalGroup = this.CreatePackageInstaller("ProductNonVitalUserGroup");