From dce1ce8dbd7af6b260446ab17c39d8904d3da55a Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 18 Dec 2023 20:01:05 -0700 Subject: [PATCH] [pfsense_rule] Add tests for interface='any' --- .../unit/plugins/modules/test_pfsense_rule_create.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/plugins/modules/test_pfsense_rule_create.py b/tests/unit/plugins/modules/test_pfsense_rule_create.py index 3855a37a..fd2fa61d 100644 --- a/tests/unit/plugins/modules/test_pfsense_rule_create.py +++ b/tests/unit/plugins/modules/test_pfsense_rule_create.py @@ -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')