Rename module's exported functions with Sso prefix on the noun part
This commit is contained in:
@@ -20,7 +20,7 @@ param(
|
||||
$modulePath = Join-Path (Split-Path $PSScriptRoot | Split-Path) "VMware.vSphere.SsoAdmin.psd1"
|
||||
Import-Module $modulePath
|
||||
|
||||
Describe "Get-Group Tests" {
|
||||
Describe "Get-SsoGroup Tests" {
|
||||
BeforeEach {
|
||||
Connect-SsoAdminServer `
|
||||
-Server $VcAddress `
|
||||
@@ -36,10 +36,10 @@ Describe "Get-Group Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Get-Group" {
|
||||
Context "Get-SsoGroup" {
|
||||
It 'Gets groups without filters' {
|
||||
# Act
|
||||
$actual = Get-Group
|
||||
$actual = Get-SsoGroup
|
||||
|
||||
# Assert
|
||||
$actual | Should Not Be $null
|
||||
@@ -55,12 +55,12 @@ Describe "Get-Group Tests" {
|
||||
|
||||
## Create Person User to determine default domain name
|
||||
## Person Users are created in the default domain
|
||||
$newPersonUser = New-PersonUser `
|
||||
$newPersonUser = New-SsoPersonUser `
|
||||
-UserName $newUserName `
|
||||
-Password $password
|
||||
|
||||
# Act
|
||||
$actual = Get-Group `
|
||||
$actual = Get-SsoGroup `
|
||||
-Domain $newPersonUser.Domain
|
||||
|
||||
# Assert
|
||||
@@ -70,7 +70,7 @@ Describe "Get-Group Tests" {
|
||||
$actual[0].Domain | Should Be $newPersonUser.Domain
|
||||
|
||||
# Cleanup
|
||||
Remove-PersonUser -User $newPersonUser
|
||||
Remove-SsoPersonUser -User $newPersonUser
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,25 +36,25 @@ Describe "LockoutPolicy Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Get-LockoutPolicy" {
|
||||
Context "Get-SsoLockoutPolicy" {
|
||||
It 'Gets lockout policy' {
|
||||
# Act
|
||||
$actual = Get-LockoutPolicy
|
||||
$actual = Get-SsoLockoutPolicy
|
||||
|
||||
# Assert
|
||||
$actual | Should Not Be $null
|
||||
}
|
||||
}
|
||||
|
||||
Context "Set-LockoutPolicy" {
|
||||
Context "Set-SsoLockoutPolicy" {
|
||||
It 'Updates lockout policy AutoUnlockIntervalSec and MaxFailedAttempts' {
|
||||
# Arrange
|
||||
$lockoutPolicyToUpdate = Get-LockoutPolicy
|
||||
$lockoutPolicyToUpdate = Get-SsoLockoutPolicy
|
||||
$expectedAutoUnlockIntervalSec = 33
|
||||
$expectedMaxFailedAttempts = 7
|
||||
|
||||
# Act
|
||||
$actual = Set-LockoutPolicy `
|
||||
$actual = Set-SsoLockoutPolicy `
|
||||
-LockoutPolicy $lockoutPolicyToUpdate `
|
||||
-AutoUnlockIntervalSec $expectedAutoUnlockIntervalSec `
|
||||
-MaxFailedAttempts $expectedMaxFailedAttempts
|
||||
@@ -67,7 +67,7 @@ Describe "LockoutPolicy Tests" {
|
||||
$actual.Description | Should Be $lockoutPolicyToUpdate.Description
|
||||
|
||||
# Cleanup
|
||||
$lockoutPolicyToUpdate | Set-LockoutPolicy
|
||||
$lockoutPolicyToUpdate | Set-SsoLockoutPolicy
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,25 +36,25 @@ Describe "PasswordPolicy Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Get-PasswordPolicy" {
|
||||
Context "Get-SsoPasswordPolicy" {
|
||||
It 'Gets password policy' {
|
||||
# Act
|
||||
$actual = Get-PasswordPolicy
|
||||
$actual = Get-SsoPasswordPolicy
|
||||
|
||||
# Assert
|
||||
$actual | Should Not Be $null
|
||||
}
|
||||
}
|
||||
|
||||
Context "Set-PasswordPolicy" {
|
||||
Context "Set-SsoPasswordPolicy" {
|
||||
It 'Updates password policy MaxLength and PasswordLifetimeDays' {
|
||||
# Arrange
|
||||
$passwordPolicyToUpdate = Get-PasswordPolicy
|
||||
$passwordPolicyToUpdate = Get-SsoPasswordPolicy
|
||||
$expectedMaxLength = 17
|
||||
$expectedPasswordLifetimeDays = 77
|
||||
|
||||
# Act
|
||||
$actual = Set-PasswordPolicy `
|
||||
$actual = Set-SsoPasswordPolicy `
|
||||
-PasswordPolicy $passwordPolicyToUpdate `
|
||||
-MaxLength $expectedMaxLength `
|
||||
-PasswordLifetimeDays $expectedPasswordLifetimeDays
|
||||
@@ -74,17 +74,17 @@ Describe "PasswordPolicy Tests" {
|
||||
$actual.MinLowercaseCount | Should Be $passwordPolicyToUpdate.MinLowercaseCount
|
||||
|
||||
# Cleanup
|
||||
$passwordPolicyToUpdate | Set-PasswordPolicy
|
||||
$passwordPolicyToUpdate | Set-SsoPasswordPolicy
|
||||
}
|
||||
|
||||
It 'Updates password policy Description and MinUppercaseCount' {
|
||||
# Arrange
|
||||
$passwordPolicyToUpdate = Get-PasswordPolicy
|
||||
$passwordPolicyToUpdate = Get-SsoPasswordPolicy
|
||||
$expectedMinUppercaseCount = 0
|
||||
$expectedDescription = "Test Description"
|
||||
|
||||
# Act
|
||||
$actual = $passwordPolicyToUpdate | Set-PasswordPolicy `
|
||||
$actual = $passwordPolicyToUpdate | Set-SsoPasswordPolicy `
|
||||
-Description $expectedDescription `
|
||||
-MinUppercaseCount $expectedMinUppercaseCount
|
||||
|
||||
@@ -103,7 +103,7 @@ Describe "PasswordPolicy Tests" {
|
||||
$actual.MinLowercaseCount | Should Be $passwordPolicyToUpdate.MinLowercaseCount
|
||||
|
||||
# Cleanup
|
||||
$passwordPolicyToUpdate | Set-PasswordPolicy
|
||||
$passwordPolicyToUpdate | Set-SsoPasswordPolicy
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ Describe "PersonUser Tests" {
|
||||
}
|
||||
AfterEach {
|
||||
foreach ($personUser in $script:usersToCleanup) {
|
||||
Remove-PersonUser -User $personUser
|
||||
Remove-SsoPersonUser -User $personUser
|
||||
}
|
||||
|
||||
$connectionsToCleanup = $global:DefaultSsoAdminServers.ToArray()
|
||||
@@ -35,7 +35,7 @@ Describe "PersonUser Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "New-PersonUser" {
|
||||
Context "New-SsoPersonUser" {
|
||||
It 'Creates person user with details' {
|
||||
# Arrange
|
||||
$expectedUserName = "TestPersonUser1"
|
||||
@@ -51,7 +51,7 @@ Describe "PersonUser Tests" {
|
||||
-SkipCertificateCheck
|
||||
|
||||
# Act
|
||||
$actual = New-PersonUser `
|
||||
$actual = New-SsoPersonUser `
|
||||
-Server $connection `
|
||||
-UserName $expectedUserName `
|
||||
-Password $expectedPassword `
|
||||
@@ -84,7 +84,7 @@ Describe "PersonUser Tests" {
|
||||
-SkipCertificateCheck
|
||||
|
||||
# Act
|
||||
$actual = New-PersonUser `
|
||||
$actual = New-SsoPersonUser `
|
||||
-Server $connection `
|
||||
-UserName $expectedUserName `
|
||||
-Password $expectedPassword
|
||||
@@ -103,7 +103,7 @@ Describe "PersonUser Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Get-PersonUser" {
|
||||
Context "Get-SsoPersonUser" {
|
||||
It 'Gets person users without filters' {
|
||||
# Arrange
|
||||
$connection = Connect-SsoAdminServer `
|
||||
@@ -113,7 +113,7 @@ Describe "PersonUser Tests" {
|
||||
-SkipCertificateCheck
|
||||
|
||||
# Act
|
||||
$actual = Get-PersonUser
|
||||
$actual = Get-SsoPersonUser
|
||||
|
||||
# Assert
|
||||
$actual | Should Not Be $null
|
||||
@@ -134,20 +134,20 @@ Describe "PersonUser Tests" {
|
||||
$secondUserName = "TestPersonUser4"
|
||||
$password = '$tr0NG_TestPa$$w0rd'
|
||||
|
||||
$personUserToSearch = New-PersonUser `
|
||||
$personUserToSearch = New-SsoPersonUser `
|
||||
-UserName $expectedUserName `
|
||||
-Password $password `
|
||||
-Server $connection
|
||||
$script:usersToCleanup += $personUserToSearch
|
||||
|
||||
$secondPersonUserToSearch = New-PersonUser `
|
||||
$secondPersonUserToSearch = New-SsoPersonUser `
|
||||
-UserName $secondUserName `
|
||||
-Password $password `
|
||||
-Server $connection
|
||||
$script:usersToCleanup += $secondPersonUserToSearch
|
||||
|
||||
# Act
|
||||
$actual = Get-PersonUser `
|
||||
$actual = Get-SsoPersonUser `
|
||||
-Name $expectedUserName `
|
||||
-Domain $personUserToSearch.Domain `
|
||||
-Server $connection
|
||||
@@ -171,20 +171,20 @@ Describe "PersonUser Tests" {
|
||||
$secondUserName = "TestPersonUser4"
|
||||
$password = '$tr0NG_TestPa$$w0rd'
|
||||
|
||||
$personUserToSearch = New-PersonUser `
|
||||
$personUserToSearch = New-SsoPersonUser `
|
||||
-UserName $expectedUserName `
|
||||
-Password $password `
|
||||
-Server $connection
|
||||
$script:usersToCleanup += $personUserToSearch
|
||||
|
||||
$secondPersonUserToSearch = New-PersonUser `
|
||||
$secondPersonUserToSearch = New-SsoPersonUser `
|
||||
-UserName $secondUserName `
|
||||
-Password $password `
|
||||
-Server $connection
|
||||
$script:usersToCleanup += $secondPersonUserToSearch
|
||||
|
||||
# Act
|
||||
$actual = Get-PersonUser `
|
||||
$actual = Get-SsoPersonUser `
|
||||
-Name "Test*" `
|
||||
-Domain $personUserToSearch.Domain `
|
||||
-Server $connection
|
||||
@@ -208,20 +208,20 @@ Describe "PersonUser Tests" {
|
||||
$secondUserName = "TestPersonUser4"
|
||||
$password = '$tr0NG_TestPa$$w0rd'
|
||||
|
||||
$personUserToSearch = New-PersonUser `
|
||||
$personUserToSearch = New-SsoPersonUser `
|
||||
-UserName $expectedUserName `
|
||||
-Password $password `
|
||||
-Server $connection
|
||||
$script:usersToCleanup += $personUserToSearch
|
||||
|
||||
$secondPersonUserToSearch = New-PersonUser `
|
||||
$secondPersonUserToSearch = New-SsoPersonUser `
|
||||
-UserName $secondUserName `
|
||||
-Password $password `
|
||||
-Server $connection
|
||||
$script:usersToCleanup += $secondPersonUserToSearch
|
||||
|
||||
# Act
|
||||
$actual = Get-PersonUser `
|
||||
$actual = Get-SsoPersonUser `
|
||||
-Name "TestPersonUser?" `
|
||||
-Domain $personUserToSearch.Domain `
|
||||
-Server $connection
|
||||
@@ -244,7 +244,7 @@ Describe "PersonUser Tests" {
|
||||
$expectedUserName = "TestPersonUser3"
|
||||
$password = '$tr0NG_TestPa$$w0rd'
|
||||
|
||||
$personUserToSearch = New-PersonUser `
|
||||
$personUserToSearch = New-SsoPersonUser `
|
||||
-UserName $expectedUserName `
|
||||
-Password $password `
|
||||
-Server $connection
|
||||
@@ -252,7 +252,7 @@ Describe "PersonUser Tests" {
|
||||
|
||||
|
||||
# Act
|
||||
$actual = Get-PersonUser `
|
||||
$actual = Get-SsoPersonUser `
|
||||
-Name "TestPersonUser" `
|
||||
-Domain $personUserToSearch.Domain `
|
||||
-Server $connection
|
||||
@@ -262,7 +262,7 @@ Describe "PersonUser Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Set-PersonUser" {
|
||||
Context "Set-SsoPersonUser" {
|
||||
It 'Adds person user to group' {
|
||||
# Arrange
|
||||
$userName = "TestAddGroupPersonUserName"
|
||||
@@ -273,20 +273,20 @@ Describe "PersonUser Tests" {
|
||||
-Password $Password `
|
||||
-SkipCertificateCheck
|
||||
|
||||
$personUserToUpdate = New-PersonUser `
|
||||
$personUserToUpdate = New-SsoPersonUser `
|
||||
-UserName $userName `
|
||||
-Password $userPassword `
|
||||
-Server $connection
|
||||
|
||||
$script:usersToCleanup += $personUserToUpdate
|
||||
|
||||
$groupUserToBeAddedTo = Get-Group `
|
||||
$groupUserToBeAddedTo = Get-SsoGroup `
|
||||
-Name 'Administrators' `
|
||||
-Domain $personUserToUpdate.Domain `
|
||||
-Server $connection
|
||||
|
||||
# Act
|
||||
$actual = Set-PersonUser `
|
||||
$actual = Set-SsoPersonUser `
|
||||
-User $personUserToUpdate `
|
||||
-Group $groupUserToBeAddedTo `
|
||||
-Add
|
||||
@@ -305,25 +305,25 @@ Describe "PersonUser Tests" {
|
||||
-Password $Password `
|
||||
-SkipCertificateCheck
|
||||
|
||||
$personUserToUpdate = New-PersonUser `
|
||||
$personUserToUpdate = New-SsoPersonUser `
|
||||
-UserName $userName `
|
||||
-Password $userPassword `
|
||||
-Server $connection
|
||||
|
||||
$script:usersToCleanup += $personUserToUpdate
|
||||
|
||||
$groupToBeUsed = Get-Group `
|
||||
$groupToBeUsed = Get-SsoGroup `
|
||||
-Name 'Administrators' `
|
||||
-Domain $personUserToUpdate.Domain `
|
||||
-Server $connection
|
||||
|
||||
Set-PersonUser `
|
||||
Set-SsoPersonUser `
|
||||
-User $personUserToUpdate `
|
||||
-Group $groupToBeUsed `
|
||||
-Add
|
||||
|
||||
# Act
|
||||
$actual = Set-PersonUser `
|
||||
$actual = Set-SsoPersonUser `
|
||||
-User $personUserToUpdate `
|
||||
-Group $groupToBeUsed `
|
||||
-Remove
|
||||
@@ -343,7 +343,7 @@ Describe "PersonUser Tests" {
|
||||
-Password $Password `
|
||||
-SkipCertificateCheck
|
||||
|
||||
$personUserToUpdate = New-PersonUser `
|
||||
$personUserToUpdate = New-SsoPersonUser `
|
||||
-UserName $userName `
|
||||
-Password $userPassword `
|
||||
-Server $connection
|
||||
@@ -351,7 +351,7 @@ Describe "PersonUser Tests" {
|
||||
$script:usersToCleanup += $personUserToUpdate
|
||||
|
||||
# Act
|
||||
$actual = Set-PersonUser `
|
||||
$actual = Set-SsoPersonUser `
|
||||
-User $personUserToUpdate `
|
||||
-NewPassword $newPassword
|
||||
|
||||
@@ -369,7 +369,7 @@ Describe "PersonUser Tests" {
|
||||
-Password $Password `
|
||||
-SkipCertificateCheck
|
||||
|
||||
$personUserToUpdate = New-PersonUser `
|
||||
$personUserToUpdate = New-SsoPersonUser `
|
||||
-UserName $userName `
|
||||
-Password $userPassword `
|
||||
-Server $connection
|
||||
@@ -377,7 +377,7 @@ Describe "PersonUser Tests" {
|
||||
$script:usersToCleanup += $personUserToUpdate
|
||||
|
||||
# Act
|
||||
$actual = Set-PersonUser `
|
||||
$actual = Set-SsoPersonUser `
|
||||
-User $personUserToUpdate `
|
||||
-Unlock
|
||||
|
||||
@@ -386,7 +386,7 @@ Describe "PersonUser Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Remove-PersonUser" {
|
||||
Context "Remove-SsoPersonUser" {
|
||||
It 'Removes person user' {
|
||||
# Arrange
|
||||
$userName = "TestPersonUser4"
|
||||
@@ -398,17 +398,17 @@ Describe "PersonUser Tests" {
|
||||
-SkipCertificateCheck
|
||||
|
||||
|
||||
$personUserToRemove = New-PersonUser `
|
||||
$personUserToRemove = New-SsoPersonUser `
|
||||
-UserName $userName `
|
||||
-Password $userPassword `
|
||||
-Server $connection
|
||||
|
||||
# Act
|
||||
Remove-PersonUser -User $personUserToRemove
|
||||
Remove-SsoPersonUser -User $personUserToRemove
|
||||
|
||||
# Assert
|
||||
$personUserToRemove | Should Not Be $null
|
||||
$userFromServer = Get-PersonUser `
|
||||
$userFromServer = Get-SsoPersonUser `
|
||||
-Name $personUserToRemove.Name `
|
||||
-Domain $personUserToRemove.Domain `
|
||||
-Server $connection
|
||||
|
||||
@@ -36,10 +36,10 @@ Describe "TokenLifetime Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Get-TokenLifetime" {
|
||||
Context "Get-SsoTokenLifetime" {
|
||||
It 'Gets token lifetime settings' {
|
||||
# Act
|
||||
$actual = Get-TokenLifetime
|
||||
$actual = Get-SsoTokenLifetime
|
||||
|
||||
# Assert
|
||||
$actual | Should Not Be $null
|
||||
@@ -48,15 +48,15 @@ Describe "TokenLifetime Tests" {
|
||||
}
|
||||
}
|
||||
|
||||
Context "Set-TokenLifetime" {
|
||||
Context "Set-SsoTokenLifetime" {
|
||||
It 'Updates MaxHoKTokenLifetime and MaxBearerTokenLifetime' {
|
||||
# Arrange
|
||||
$tokenLifetimeToUpdate = Get-TokenLifetime
|
||||
$tokenLifetimeToUpdate = Get-SsoTokenLifetime
|
||||
$expectedMaxHoKTokenLifetime = 60
|
||||
$expectedMaxBearerTokenLifetime = 30
|
||||
|
||||
# Act
|
||||
$actual = Set-TokenLifetime `
|
||||
$actual = Set-SsoTokenLifetime `
|
||||
-TokenLifetime $tokenLifetimeToUpdate `
|
||||
-MaxHoKTokenLifetime $expectedMaxHoKTokenLifetime `
|
||||
-MaxBearerTokenLifetime $expectedMaxBearerTokenLifetime
|
||||
@@ -67,7 +67,7 @@ Describe "TokenLifetime Tests" {
|
||||
$actual.MaxBearerTokenLifetime | Should Be $expectedMaxBearerTokenLifetime
|
||||
|
||||
# Cleanup
|
||||
$tokenLifetimeToUpdate | Set-TokenLifetime `
|
||||
$tokenLifetimeToUpdate | Set-SsoTokenLifetime `
|
||||
-MaxHoKTokenLifetime $tokenLifetimeToUpdate.MaxHoKTokenLifetime `
|
||||
-MaxBearerTokenLifetime $tokenLifetimeToUpdate.MaxBearerTokenLifetime
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user