Skip to content

Commit

Permalink
Certificate(Tests): Use -skip for skip some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Dec 8, 2023
1 parent 7dbc0e9 commit a8f7319
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
1 change: 1 addition & 0 deletions Tests/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $script:MyNewSecurePassword = ConvertTo-SecureString MyNewassword -AsPlainText -
$script:VersionBefore680 = $DefaultArubaCPConnection.Version -lt [version]"6.8.0"
$script:VersionBefore686 = $DefaultArubaCPConnection.Version -lt [version]"6.8.6"
$script:VersionBefore690 = $DefaultArubaCPConnection.Version -lt [version]"6.9.0"
$script:VersionBefore6100 = $DefaultArubaCPConnection.Version -lt [version]"6.10.0"

$script:server_uuid = (Get-ArubaCPServerConfiguration).server_uuid[0]

Expand Down
48 changes: 21 additions & 27 deletions Tests/integration/Certificates.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,37 @@ Describe "Get Cluster Certificates (Get-ArubaCPClusterCertificate)" {
} | Should -Not -Throw
}

if ($DefaultArubaCPConnection.version -gt "6.10.0") {
It "Get Cluster Certificates with service_name Does not throw an error" {
{
Get-ArubaCPClusterCertificate -service_name "HTTPS(ECC)"
} | Should -Not -Throw
}
It "Get Cluster Certificates with service_name Does not throw an error" -Skip:$VersionBefore6100 {
{
Get-ArubaCPClusterCertificate -service_name "HTTPS(ECC)"
} | Should -Not -Throw
}

if ($DefaultArubaCPConnection.version -gt "6.10.0") {
It "Get Cluster Certificates with service_type Does not throw an error" {
{
Get-ArubaCPClusterCertificate -certificate_type "HTTPS(RSA) Server Certificate"
} | Should -Not -Throw
}

It "Get Cluster Certificates with service_type Does not throw an error" -Skip:$VersionBefore6100 {
{
Get-ArubaCPClusterCertificate -certificate_type "HTTPS(RSA) Server Certificate"
} | Should -Not -Throw
}


It "Get Cluster Certificates with service_id" {
$cc = Get-ArubaCPClusterCertificate -service_id 1
@($cc).count | Should -Not -Be $NULL
}

if ($DefaultArubaCPConnection.version -gt "6.10.0") {
It "Get Cluster Certificates with service_name" {
$cc = Get-ArubaCPClusterCertificate -service_name "HTTPS(ECC)"
@($cc).count | Should -Not -Be $NULL
}
It "Get Cluster Certificates with service_name" -Skip:$VersionBefore6100 {
$cc = Get-ArubaCPClusterCertificate -service_name "HTTPS(ECC)"
@($cc).count | Should -Not -Be $NULL
}

if ($DefaultArubaCPConnection.version -gt "6.10.0") {
It "Get Cluster Certificates with service_type" {
$cc = Get-ArubaCPClusterCertificate -certificate_type "HTTPS(RSA) Server Certificate"
@($cc).count | Should -Not -Be $NULL
}

It "Get Cluster Certificates with service_type" -Skip:$VersionBefore6100 {
$cc = Get-ArubaCPClusterCertificate -certificate_type "HTTPS(RSA) Server Certificate"
@($cc).count | Should -Not -Be $NULL
}


}

Describe "Get Server Certificate (Get-ArubaCPServerCertificate)" {
Expand All @@ -83,11 +79,9 @@ Describe "Get Server Certificate (Get-ArubaCPServerCertificate)" {
@($cc).count | Should -Not -Be $NULL
}

if ($DefaultArubaCPConnection.version -gt "6.10.0") {
It "Get Server Certificate and confirm" {
$cc = Get-ArubaCPServerCertificate -service_name "HTTPS(RSA)" -server_uuid $server_uuid
Confirm-ArubaCPServerCertificate $cc | Should -Be $true
}
It "Get Server Certificate and confirm" -Skip:$VersionBefore6100 {
$cc = Get-ArubaCPServerCertificate -service_name "HTTPS(RSA)" -server_uuid $server_uuid
Confirm-ArubaCPServerCertificate $cc | Should -Be $true
}

}
Expand Down

0 comments on commit a8f7319

Please sign in to comment.