Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
DFW: Add test for Set-NsxFirewallRule cmdlets
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Apr 24, 2018
1 parent f02aa94 commit 404d969
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/integration/05.Dfw.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Describe "DFW" {
$script:DefaultNsxConnection = Connect-NsxServer -vCenterServer $PNSXTestVC -NsxServerHint $PNSXTestNSX -Credential $PNSXTestDefViCred -ViWarningAction "Ignore"
$script:cl = get-cluster | select -first 1
write-warning "Using cluster $cl for edge appliance deployment"
$script:ds = $cl | get-datastore | select -first 1
$script:ds = $cl | get-datastore | select -first 1
write-warning "Using datastore $ds for edge appliance deployment"
$script:dc = Get-Datacenter | select -first 1
write-warning "Using Datacenter $dc for object identifier"
Expand Down Expand Up @@ -1938,6 +1938,21 @@ Describe "DFW" {
{$section | New-NsxFirewallRule -Name "pester_dfw_bottom" -action allow -position bottom } | should throw
}

it "Can modified an l3 rule" {
$rule = $l3sec | New-NsxFirewallRule -Name "pester_dfw_rule1" -action deny -EnableLogging
$rule | should not be $null
$rule.name | should be "pester_dfw_rule1"
$rule.action | should be deny
$rule.disabled | should be "false"
$rule.logged | should be "true"
$rule = Get-NsxFirewallSection -Name $l3sectionname | Get-NsxFirewallRule -Name "pester_dfw_rule1" | Set-NsxFirewallRule -name "modified_pester_dfw_rule1" -action allow -disabled:$true -logged:$false
$rule | should not be $null
$rule.name | should be "modified_pester_dfw_rule1"
$rule.action | should be allow
$rule.disabled | should be "true"
$rule.logged | should be "false"
}

BeforeEach {
#create new sections for each test.

Expand Down

0 comments on commit 404d969

Please sign in to comment.