Skip to content

Commit

Permalink
[pfsense_rule] Add tests for interface='any'
Browse files Browse the repository at this point in the history
  • Loading branch information
opoplawski committed Jan 7, 2024
1 parent 6b5f321 commit dce1ce8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unit/plugins/modules/test_pfsense_rule_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ def test_rule_create_floating(self):
command = "create rule 'one_rule' on 'floating(lan)', source='any', destination='any', direction='any'"
self.do_module_test(obj, command=command)

def test_rule_create_floating_any(self):
""" test creation of a new floating rule with any interface """
obj = dict(name='one_rule', source='any', destination='any', interface='any', floating='yes', direction='any')
command = "create rule 'one_rule' on 'floating(any)', source='any', destination='any', direction='any'"

def test_rule_create_non_floating_any(self):
""" test creation of a new rule with any interface """
obj = dict(name='one_rule', source='any', destination='any', interface='any', floating='no', direction='any')
msg = "any is not a valid interface"
self.do_module_test(obj, failed=True, msg=msg)

def test_rule_create_floating_quick(self):
""" test creation of a new floating rule with quick match """
obj = dict(name='one_rule', source='any', destination='any', interface='lan', floating='yes', direction='any', quick='yes')
Expand Down

0 comments on commit dce1ce8

Please sign in to comment.