From 224b90b1a3c6116bf512be7a8f17a77c1236cf7e Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Tue, 24 Oct 2023 23:01:18 +0200 Subject: [PATCH] meta(Tests): Fix q_no_edit is not available with FortiOS 6.0.x --- Tests/integration/FirewallAddress.Tests.ps1 | 4 +++- Tests/integration/FirewallAddressGroup.Tests.ps1 | 4 +++- Tests/integration/FirewallPolicy.Tests.ps1 | 4 +++- Tests/integration/FirewallProxyAddress.Tests.ps1 | 4 +++- Tests/integration/FirewallProxyAddressGroup.Tests.ps1 | 4 +++- Tests/integration/FirewallProxyPolicy.Tests.ps1 | 4 +++- Tests/integration/FirewallVip.Tests.ps1 | 4 +++- Tests/integration/FirewallVipGroup.Tests.ps1 | 4 +++- Tests/integration/RouterStatic.Tests.ps1 | 4 +++- Tests/integration/SystemInterface.Tests.ps1 | 4 +++- Tests/integration/SystemZone.Tests.ps1 | 4 +++- Tests/integration/VpnIPsecPhase1Interface.Tests.ps1 | 4 +++- Tests/integration/VpnIPsecPhase2Interface.Tests.ps1 | 4 +++- 13 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Tests/integration/FirewallAddress.Tests.ps1 b/Tests/integration/FirewallAddress.Tests.ps1 index a18bfb95..c7a6e360 100644 --- a/Tests/integration/FirewallAddress.Tests.ps1 +++ b/Tests/integration/FirewallAddress.Tests.ps1 @@ -58,7 +58,9 @@ Describe "Get Firewall Address" { $address.q_path | Should -Be "firewall" $address.q_name | Should -Be "address" $address.q_mkey_type | Should -Be "string" - $address.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $address.q_no_edit | Should -Not -BeNullOrEmpty + } $address.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/FirewallAddressGroup.Tests.ps1 b/Tests/integration/FirewallAddressGroup.Tests.ps1 index 6dd572f3..11550d4d 100644 --- a/Tests/integration/FirewallAddressGroup.Tests.ps1 +++ b/Tests/integration/FirewallAddressGroup.Tests.ps1 @@ -60,7 +60,9 @@ Describe "Get Firewall Address Group" { $addressgroup.q_path | Should -Be "firewall" $addressgroup.q_name | Should -Be "addrgrp" $addressgroup.q_mkey_type | Should -Be "string" - $addressgroup.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $addressgroup.q_no_edit | Should -Not -BeNullOrEmpty + } $addressgroup.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/FirewallPolicy.Tests.ps1 b/Tests/integration/FirewallPolicy.Tests.ps1 index 438f9af3..4415d66a 100644 --- a/Tests/integration/FirewallPolicy.Tests.ps1 +++ b/Tests/integration/FirewallPolicy.Tests.ps1 @@ -57,7 +57,9 @@ Describe "Get Firewall Policy" { $policy.q_path | Should -Be "firewall" $policy.q_name | Should -Be "policy" $policy.q_mkey_type | Should -Be "integer" - $policy.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $policy.q_no_edit | Should -Not -BeNullOrEmpty + } #$policy.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/FirewallProxyAddress.Tests.ps1 b/Tests/integration/FirewallProxyAddress.Tests.ps1 index 53206464..3b547ed0 100644 --- a/Tests/integration/FirewallProxyAddress.Tests.ps1 +++ b/Tests/integration/FirewallProxyAddress.Tests.ps1 @@ -58,7 +58,9 @@ Describe "Get Firewall Proxy Address" { $address.q_path | Should -Be "firewall" $address.q_name | Should -Be "proxy-address" $address.q_mkey_type | Should -Be "string" - $address.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $address.q_no_edit | Should -Not -BeNullOrEmpty + } $address.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/FirewallProxyAddressGroup.Tests.ps1 b/Tests/integration/FirewallProxyAddressGroup.Tests.ps1 index bb41ab08..b7d6ac76 100644 --- a/Tests/integration/FirewallProxyAddressGroup.Tests.ps1 +++ b/Tests/integration/FirewallProxyAddressGroup.Tests.ps1 @@ -61,7 +61,9 @@ Describe "Get Firewall Proxy Address Group" { $addressgroup.q_path | Should -Be "firewall" $addressgroup.q_name | Should -Be "proxy-addrgrp" $addressgroup.q_mkey_type | Should -Be "string" - $addressgroup.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $addressgroup.q_no_edit | Should -Not -BeNullOrEmpty + } $addressgroup.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/FirewallProxyPolicy.Tests.ps1 b/Tests/integration/FirewallProxyPolicy.Tests.ps1 index 639aedcb..01da583b 100644 --- a/Tests/integration/FirewallProxyPolicy.Tests.ps1 +++ b/Tests/integration/FirewallProxyPolicy.Tests.ps1 @@ -57,7 +57,9 @@ Describe "Get Firewall Proxy Policy" { $policy.q_path | Should -Be "firewall" $policy.q_name | Should -Be "proxy-policy" $policy.q_mkey_type | Should -Be "integer" - $policy.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $policy.q_no_edit | Should -Not -BeNullOrEmpty + } #$policy.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/FirewallVip.Tests.ps1 b/Tests/integration/FirewallVip.Tests.ps1 index c1c5e419..1a02e3db 100644 --- a/Tests/integration/FirewallVip.Tests.ps1 +++ b/Tests/integration/FirewallVip.Tests.ps1 @@ -56,7 +56,9 @@ Describe "Get Firewall VIP" { $vip.q_path | Should -Be "firewall" $vip.q_name | Should -Be "vip" $vip.q_mkey_type | Should -Be "string" - $vip.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $vip.q_no_edit | Should -Not -BeNullOrEmpty + } $vip.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/FirewallVipGroup.Tests.ps1 b/Tests/integration/FirewallVipGroup.Tests.ps1 index 04bb5455..b4285315 100644 --- a/Tests/integration/FirewallVipGroup.Tests.ps1 +++ b/Tests/integration/FirewallVipGroup.Tests.ps1 @@ -60,7 +60,9 @@ Describe "Get Firewall Vip Group" { $vipgroup.q_path | Should -Be "firewall" $vipgroup.q_name | Should -Be "vipgrp" $vipgroup.q_mkey_type | Should -Be "string" - $vipgroup.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $vipgroup.q_no_edit | Should -Not -BeNullOrEmpty + } $vipgroup.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/RouterStatic.Tests.ps1 b/Tests/integration/RouterStatic.Tests.ps1 index 4fe00940..dd4ae388 100644 --- a/Tests/integration/RouterStatic.Tests.ps1 +++ b/Tests/integration/RouterStatic.Tests.ps1 @@ -50,7 +50,9 @@ Describe "Get Static Route" { $route.q_path | Should -Be "router" $route.q_name | Should -Be "static" $route.q_mkey_type | Should -Be "integer" - $route.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $route.q_no_edit | Should -Not -BeNullOrEmpty + } #$route.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/SystemInterface.Tests.ps1 b/Tests/integration/SystemInterface.Tests.ps1 index cf0e8b42..29ff0bdd 100644 --- a/Tests/integration/SystemInterface.Tests.ps1 +++ b/Tests/integration/SystemInterface.Tests.ps1 @@ -54,7 +54,9 @@ Describe "Get System Interface" { $interface.q_path | Should -Be "system" $interface.q_name | Should -Be "interface" $interface.q_mkey_type | Should -Be "string" - $interface.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $interface.q_no_edit | Should -Not -BeNullOrEmpty + } #$interface.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/SystemZone.Tests.ps1 b/Tests/integration/SystemZone.Tests.ps1 index 110c6456..2fab5414 100644 --- a/Tests/integration/SystemZone.Tests.ps1 +++ b/Tests/integration/SystemZone.Tests.ps1 @@ -50,7 +50,9 @@ Describe "Get zone" { $zone.q_path | Should -Be "system" $zone.q_name | Should -Be "zone" $zone.q_mkey_type | Should -Be "string" - $zone.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $zone.q_no_edit | Should -Not -BeNullOrEmpty + } #$zone.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/VpnIPsecPhase1Interface.Tests.ps1 b/Tests/integration/VpnIPsecPhase1Interface.Tests.ps1 index 02951dfd..3f3df158 100644 --- a/Tests/integration/VpnIPsecPhase1Interface.Tests.ps1 +++ b/Tests/integration/VpnIPsecPhase1Interface.Tests.ps1 @@ -55,7 +55,9 @@ Describe "Get VPN Ipsec Phase 1 Interface" { $interface.q_path | Should -Be "vpn.ipsec" $interface.q_name | Should -Be "phase1-interface" $interface.q_mkey_type | Should -Be "string" - $interface.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $interface.q_no_edit | Should -Not -BeNullOrEmpty + } #$interface.q_class | Should -Not -BeNullOrEmpty } diff --git a/Tests/integration/VpnIPsecPhase2Interface.Tests.ps1 b/Tests/integration/VpnIPsecPhase2Interface.Tests.ps1 index 0feb75ab..5de43a3a 100644 --- a/Tests/integration/VpnIPsecPhase2Interface.Tests.ps1 +++ b/Tests/integration/VpnIPsecPhase2Interface.Tests.ps1 @@ -57,7 +57,9 @@ Describe "Get VPN Ipsec Phase 2 Interface" { $interface.q_path | Should -Be "vpn.ipsec" $interface.q_name | Should -Be "phase2-interface" $interface.q_mkey_type | Should -Be "string" - $interface.q_no_edit | Should -Not -BeNullOrEmpty + if ($DefaultFGTConnection.version -ge "6.2.0") { + $interface.q_no_edit | Should -Not -BeNullOrEmpty + } #$interface.q_class | Should -Not -BeNullOrEmpty }