Skip to content

Commit

Permalink
Fix nas-id in tests using -skip
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Moreau committed Sep 12, 2024
1 parent 5093985 commit d106ba4
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions Tests/integration/UserRadius.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,13 @@ Describe "Add User RADIUS" {
$userradius."nas-ip" | Should -Be "192.0.2.1"
}

if ($DefaultFGTConnection.version -ge "7.0.0") {
It "Add User RADIUS Server $pester_userradius with NAS ID" {
Add-FGTUserRADIUS -Name $pester_userradius -server $pester_userradiusserver1 -secret $pester_userradius_secret -nas_id PowerFGT
$userradius = Get-FGTUserRADIUS -name $pester_userradius
$userradius.name | Should -Be $pester_userradius
$userradius.server | Should -Be $pester_userradiusserver1
$userradius.secret | Should -Not -Be $Null
$userradius."nas-id" | Should -Be "PowerFGT"
}
It "Add User RADIUS Server $pester_userradius with NAS ID" -skip:($fgt_version -lt "7.0.0") {
Add-FGTUserRADIUS -Name $pester_userradius -server $pester_userradiusserver1 -secret $pester_userradius_secret -nas_id PowerFGT
$userradius = Get-FGTUserRADIUS -name $pester_userradius
$userradius.name | Should -Be $pester_userradius
$userradius.server | Should -Be $pester_userradiusserver1
$userradius.secret | Should -Not -Be $Null
$userradius."nas-id" | Should -Be "PowerFGT"
}

It "Try to Add User RADIUS Server $pester_userradius (but there is already a object with same name)" {
Expand Down Expand Up @@ -268,13 +266,11 @@ Describe "Configure User RADIUS" {
$userradius."nas-ip" | Should -Be "192.2.0.2"
}

if ($DefaultFGTConnection.version -ge "7.0.0") {
It "Change NAS ID" {
Get-FGTUserRADIUS -name $pester_userradius | Set-FGTuserRADIUS -nas_id "PowerFGT"
$userradius = Get-FGTUserRADIUS -name $pester_userradius
$userradius.name | Should -Be $pester_userradius
$userradius."nas-id" | Should -Be "PowerFGT"
}
It "Change NAS ID" -skip:($fgt_version -lt "7.0.0") {
Get-FGTUserRADIUS -name $pester_userradius | Set-FGTuserRADIUS -nas_id "PowerFGT"
$userradius = Get-FGTUserRADIUS -name $pester_userradius
$userradius.name | Should -Be $pester_userradius
$userradius."nas-id" | Should -Be "PowerFGT"
}

AfterAll {
Expand Down

0 comments on commit d106ba4

Please sign in to comment.