From d106ba4bd654fb1aafa3818cd0d8c8ac0f0ac843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Thu, 12 Sep 2024 16:17:18 +0200 Subject: [PATCH] Fix nas-id in tests using -skip --- Tests/integration/UserRadius.Tests.ps1 | 28 +++++++++++--------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Tests/integration/UserRadius.Tests.ps1 b/Tests/integration/UserRadius.Tests.ps1 index 739f1ac0..41387388 100644 --- a/Tests/integration/UserRadius.Tests.ps1 +++ b/Tests/integration/UserRadius.Tests.ps1 @@ -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)" { @@ -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 {