Skip to content

Commit

Permalink
Fix nas-id (not existing in 7.0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Moreau committed Sep 13, 2024
1 parent d106ba4 commit b4c8e8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions PowerFGT/Public/cmdb/user/radius.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ function Add-FGTUserRADIUS {

if ( $PsBoundParameters.ContainsKey('nas_id') ) {
#before 7.x.x, there is no nas-id parameter
if ($connection.version -lt "7.0.0") {
Write-Warning "-nas-id parameter is not available before FortiOS 7.0.x"
if ($connection.version -lt "7.2.0") {
Write-Warning "-nas-id parameter is not available before FortiOS 7.2.x"
}
else {
$radius | add-member -name "nas-id-type" -membertype NoteProperty -Value "custom"
Expand Down
4 changes: 2 additions & 2 deletions Tests/integration/UserRadius.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Describe "Add User RADIUS" {
$userradius."nas-ip" | Should -Be "192.0.2.1"
}

It "Add User RADIUS Server $pester_userradius with NAS ID" -skip:($fgt_version -lt "7.0.0") {
It "Add User RADIUS Server $pester_userradius with NAS ID" -skip:($fgt_version -lt "7.2.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
Expand Down Expand Up @@ -266,7 +266,7 @@ Describe "Configure User RADIUS" {
$userradius."nas-ip" | Should -Be "192.2.0.2"
}

It "Change NAS ID" -skip:($fgt_version -lt "7.0.0") {
It "Change NAS ID" -skip:($fgt_version -lt "7.2.0") {
Get-FGTUserRADIUS -name $pester_userradius | Set-FGTuserRADIUS -nas_id "PowerFGT"
$userradius = Get-FGTUserRADIUS -name $pester_userradius
$userradius.name | Should -Be $pester_userradius
Expand Down

0 comments on commit b4c8e8d

Please sign in to comment.