diff options
| author | Ron Martin <cpuwzd@comcast.net> | 2022-08-29 18:38:07 -0400 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2022-10-21 19:08:08 -0700 |
| commit | 08cdc6aa2b9dd0e273a3c3a22893616d26342a0e (patch) | |
| tree | 1d0b9f7e21cec02abfda50b1a3c6d0c24308998b /src/test/burn | |
| parent | 40bd65379768f99ec28bffe2691ba43c78c9e9c4 (diff) | |
| download | wix-08cdc6aa2b9dd0e273a3c3a22893616d26342a0e.tar.gz wix-08cdc6aa2b9dd0e273a3c3a22893616d26342a0e.tar.bz2 wix-08cdc6aa2b9dd0e273a3c3a22893616d26342a0e.zip | |
Support add, modify and remove comments on user accounts
Fixes 5371
Diffstat (limited to 'src/test/burn')
| -rw-r--r-- | src/test/burn/WixTestTools/MSIExec.cs | 2 | ||||
| -rw-r--r-- | src/test/burn/WixTestTools/UserVerifier.cs | 41 |
2 files changed, 39 insertions, 4 deletions
diff --git a/src/test/burn/WixTestTools/MSIExec.cs b/src/test/burn/WixTestTools/MSIExec.cs index a905ec5a..fb161495 100644 --- a/src/test/burn/WixTestTools/MSIExec.cs +++ b/src/test/burn/WixTestTools/MSIExec.cs | |||
| @@ -259,7 +259,7 @@ namespace WixTestTools | |||
| 259 | arguments.Append(" /a "); | 259 | arguments.Append(" /a "); |
| 260 | break; | 260 | break; |
| 261 | case MSIExecMode.Repair: | 261 | case MSIExecMode.Repair: |
| 262 | arguments.Append(" /f "); | 262 | arguments.Append(" /fvomusa "); |
| 263 | break; | 263 | break; |
| 264 | case MSIExecMode.Cleanup: | 264 | case MSIExecMode.Cleanup: |
| 265 | case MSIExecMode.Uninstall: | 265 | case MSIExecMode.Uninstall: |
diff --git a/src/test/burn/WixTestTools/UserVerifier.cs b/src/test/burn/WixTestTools/UserVerifier.cs index b5218a79..51c6c31e 100644 --- a/src/test/burn/WixTestTools/UserVerifier.cs +++ b/src/test/burn/WixTestTools/UserVerifier.cs | |||
| @@ -49,7 +49,7 @@ namespace WixTestTools | |||
| 49 | UserPrincipal newUser = new UserPrincipal(new PrincipalContext(ContextType.Machine)); | 49 | UserPrincipal newUser = new UserPrincipal(new PrincipalContext(ContextType.Machine)); |
| 50 | newUser.SetPassword(password); | 50 | newUser.SetPassword(password); |
| 51 | newUser.Name = userName; | 51 | newUser.Name = userName; |
| 52 | newUser.Description = "New test User"; | 52 | newUser.Description = String.Empty; |
| 53 | newUser.UserCannotChangePassword = true; | 53 | newUser.UserCannotChangePassword = true; |
| 54 | newUser.PasswordNeverExpires = false; | 54 | newUser.PasswordNeverExpires = false; |
| 55 | newUser.Save(); | 55 | newUser.Save(); |
| @@ -109,6 +109,24 @@ namespace WixTestTools | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | /// <summary> | 111 | /// <summary> |
| 112 | /// Sets the user comment for a given user | ||
| 113 | /// </summary> | ||
| 114 | /// <param name="domainName">domain name for the user, empty for local users</param> | ||
| 115 | /// <param name="userName">the user name</param> | ||
| 116 | /// <param name="comment">comment to be set for the user</param> | ||
| 117 | public static void SetUserComment(string domainName, string userName, string comment) | ||
| 118 | { | ||
| 119 | UserPrincipal user = GetUser(domainName, userName); | ||
| 120 | |||
| 121 | Assert.False(null == user, String.Format("User '{0}' was not found under domain '{1}'.", userName, domainName)); | ||
| 122 | |||
| 123 | var directoryEntry = user.GetUnderlyingObject() as DirectoryEntry; | ||
| 124 | Assert.False(null == directoryEntry); | ||
| 125 | directoryEntry.Properties["Description"].Value = comment; | ||
| 126 | user.Save(); | ||
| 127 | } | ||
| 128 | |||
| 129 | /// <summary> | ||
| 112 | /// Adds the specified user to the specified local group | 130 | /// Adds the specified user to the specified local group |
| 113 | /// </summary> | 131 | /// </summary> |
| 114 | /// <param name="userName">User to add</param> | 132 | /// <param name="userName">User to add</param> |
| @@ -162,7 +180,24 @@ namespace WixTestTools | |||
| 162 | } | 180 | } |
| 163 | 181 | ||
| 164 | /// <summary> | 182 | /// <summary> |
| 165 | /// Verify that a givin user is member of a local group | 183 | /// Verifies the user comment for a given user |
| 184 | /// </summary> | ||
| 185 | /// <param name="domainName">domain name for the user, empty for local users</param> | ||
| 186 | /// <param name="userName">the user name</param> | ||
| 187 | /// <param name="comment">the comment to be verified</param> | ||
| 188 | public static void VerifyUserComment(string domainName, string userName, string comment) | ||
| 189 | { | ||
| 190 | UserPrincipal user = GetUser(domainName, userName); | ||
| 191 | |||
| 192 | Assert.False(null == user, String.Format("User '{0}' was not found under domain '{1}'.", userName, domainName)); | ||
| 193 | |||
| 194 | var directoryEntry = user.GetUnderlyingObject() as DirectoryEntry; | ||
| 195 | Assert.False(null == directoryEntry); | ||
| 196 | Assert.True(comment == (string)(directoryEntry.Properties["Description"].Value)); | ||
| 197 | } | ||
| 198 | |||
| 199 | /// <summary> | ||
| 200 | /// Verify that a given user is member of a local group | ||
| 166 | /// </summary> | 201 | /// </summary> |
| 167 | /// <param name="domainName">domain name for the user, empty for local users</param> | 202 | /// <param name="domainName">domain name for the user, empty for local users</param> |
| 168 | /// <param name="userName">the user name</param> | 203 | /// <param name="userName">the user name</param> |
| @@ -322,7 +357,6 @@ namespace WixTestTools | |||
| 322 | missedAGroup = true; | 357 | missedAGroup = true; |
| 323 | message += String.Format("Local group '{0}' was not found. \r\n", groupName); | 358 | message += String.Format("Local group '{0}' was not found. \r\n", groupName); |
| 324 | } | 359 | } |
| 325 | |||
| 326 | } | 360 | } |
| 327 | Assert.False(missedAGroup, message); | 361 | Assert.False(missedAGroup, message); |
| 328 | } | 362 | } |
| @@ -346,3 +380,4 @@ namespace WixTestTools | |||
| 346 | } | 380 | } |
| 347 | } | 381 | } |
| 348 | } | 382 | } |
| 383 | |||
