Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
cliSettings: Remove test-suite for [Get|Set]-NsxcliSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Jul 31, 2019
1 parent 9fa80ff commit 44a1e1e
Showing 1 changed file with 9 additions and 41 deletions.
50 changes: 9 additions & 41 deletions tests/integration/04.Edge.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -729,74 +729,42 @@ Describe "Edge" {
Context "CliSettings" {

it "Can retrieve cliSettings" {
$cliSettings = Get-NsxEdge $name | Get-NsxcliSettings
$cliSettings | should not be NULL
$edge = Get-NsxEdge $name
$edge.cliSettings | should not be NULL
#By default it is admin
$cliSettings.userName | should be "admin"
$edge.cliSettings.userName | should be "admin"
#By default it is 99999
$cliSettings.passwordExpiry | should be "99999"

}
it "Can disable SSH" {
$edge = Get-NsxEdge $name
#Need Always to set a password to change cliSettings
Get-NsxEdge $name | Get-NsxcliSettings | Set-NsxCliSettings -password Vmware1!Vmware1! -remoteAccess:$false
$edge = Get-NsxEdge $name
$edge.cliSettings.remoteAccess | should be "false"
}

it "Can enable SSH" {
Get-NsxEdge $name | Get-NsxcliSettings | Set-NsxCliSettings -password Vmware1!Vmware1! -remoteAccess:$true
$edge = Get-NsxEdge $name
$edge.cliSettings.remoteAccess | should be "true"
}

it "Change (SSH) username" {
Get-NsxEdge $name | Get-NsxcliSettings | Set-NsxCliSettings -password Vmware1!Vmware1! -userName powernsx
$edge = Get-NsxEdge $name
$edge.cliSettings.userName | should be "powernsx"
$edge.cliSettings.passwordExpiry | should be "99999"
}

it "Change Password Expiry" {
Get-NsxEdge $name | Get-NsxcliSettings | Set-NsxCliSettings -password Vmware1!Vmware1! -passwordExpiry 42
$edge = Get-NsxEdge $name
$edge.cliSettings.passwordExpiry | should be "42"
}

it "Change sshLoginBannerText" {
Get-NsxEdge $name | Get-NsxcliSettings | Set-NsxCliSettings -password Vmware1!Vmware1! -sshLoginBannerText "Secure ESG SSH Access don't connect !"
$edge = Get-NsxEdge $name
$edge.cliSettings.sshLoginBannerText | should be "Secure ESG SSH Access don't connect !"
}

it "Can disable SSH via Set-NsxEdge" {
it "Can disable SSH" {
$edge = Get-NsxEdge $name
Get-NsxEdge $name | Set-NsxEdge -remoteAccess:$false -confirm:$false
$edge = Get-NsxEdge $name
$edge.cliSettings.remoteAccess | should be "false"
}

it "Can enable SSH via Set-NsxEdge" {
it "Can enable SSH" {
Get-NsxEdge $name | Set-NsxEdge -remoteAccess:$true -confirm:$false
$edge = Get-NsxEdge $name
$edge.cliSettings.remoteAccess | should be "true"
}

it "Change (SSH) username (and Password) via Set-NsxEdge" {
it "Change (SSH) username (and Password)" {
#it is mandatory to change username (and Password) on the same time (bug or feature ?)
Get-NsxEdge $name | Set-NsxEdge -userName powernsxviasetnsxedge -Password "Vmware1!Vmware1!" -confirm:$false
$edge = Get-NsxEdge $name
$edge.cliSettings.userName | should be "powernsxviasetnsxedge"
#It is impossible to check if the password is modified...
}

it "Change Password Expiry via Set-NsxEdge" {
it "Change Password Expiry" {
Get-NsxEdge $name | Set-NsxEdge -passwordExpiry 4242 -confirm:$false
$edge = Get-NsxEdge $name
$edge.cliSettings.passwordExpiry | should be "4242"
}

it "Change sshLoginBannerText via Set-NsxEdge" {
it "Change sshLoginBannerText" {
Get-NsxEdge $name | Set-NsxEdge -sshLoginBannerText "Secured by Set-NsxEdge" -confirm:$false
$edge = Get-NsxEdge $name
$edge.cliSettings.sshLoginBannerText | should be "Secured by Set-NsxEdge"
Expand Down

0 comments on commit 44a1e1e

Please sign in to comment.