Skip to content

Commit 8d193df

Browse files
test(FirewallRule): ensure we can create a floating rule with the 'any' interface #840
1 parent e04d4b3 commit 8d193df

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallRuleTestCase.inc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,4 +993,21 @@ class APIModelsFirewallRuleTestCase extends TestCase {
993993
$this->assert_equals($rule->updated_by->value, "$client->username@$client->ip_address (API)");
994994
}
995995
}
996+
997+
/**
998+
* Checks that we can create a floating firewall rule with the 'any' interface
999+
*/
1000+
public function test_floating_rule_with_any_interface(): void {
1001+
# Create a firewall rule to test with
1002+
$rule = new FirewallRule(
1003+
type: 'pass',
1004+
interface: ['any'],
1005+
ipprotocol: 'inet',
1006+
protocol: 'tcp',
1007+
source: 'any',
1008+
destination: 'any',
1009+
floating: true,
1010+
);
1011+
$rule->validate();
1012+
}
9961013
}

0 commit comments

Comments
 (0)