Skip to content

Commit

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

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

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"
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"
}
}

AfterAll {
Expand Down

0 comments on commit 5093985

Please sign in to comment.