From e4a325bcb54ff6b2b432952681e05e5171b658a9 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 16 Aug 2021 13:51:39 +0530 Subject: [PATCH] firewalld: Correct usage of queryForwardPort * Correct queryForwardPort API usage * Enable port_foward_test_cases tests Fixes: #247 Signed-off-by: Abhijeet Kasurde --- plugins/modules/firewalld.py | 2 +- .../integration/targets/firewalld/tasks/run_all_tests.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/modules/firewalld.py b/plugins/modules/firewalld.py index f892cd38c84..95bfe53eab3 100644 --- a/plugins/modules/firewalld.py +++ b/plugins/modules/firewalld.py @@ -706,7 +706,7 @@ def get_enabled_immediate(self, port, proto, toport, toaddr, timeout): if self.fw_offline: dummy, fw_settings = self.get_fw_zone_settings() return fw_settings.queryForwardPort(port=port, protocol=proto, to_port=toport, to_addr=toaddr) - return self.fw.queryForwardPort(port=port, protocol=proto, to_port=toport, to_addr=toaddr) + return self.fw.queryForwardPort(zone=self.zone, port=port, protocol=proto, toport=toport, toaddr=toaddr) def get_enabled_permanent(self, port, proto, toport, toaddr, timeout): dummy, fw_settings = self.get_fw_zone_settings() diff --git a/tests/integration/targets/firewalld/tasks/run_all_tests.yml b/tests/integration/targets/firewalld/tasks/run_all_tests.yml index 29d253d7769..c125a9e2a74 100644 --- a/tests/integration/targets/firewalld/tasks/run_all_tests.yml +++ b/tests/integration/targets/firewalld/tasks/run_all_tests.yml @@ -14,7 +14,10 @@ - include_tasks: port_test_cases.yml # firewalld source operation test cases -- import_tasks: source_test_cases.yml +- include_tasks: source_test_cases.yml # firewalld zone target operation test cases -- import_tasks: zone_target_test_cases.yml \ No newline at end of file +- include_tasks: zone_target_test_cases.yml + +# firewalld port forwarding operation test cases +- include_tasks: port_foward_test_cases.yml \ No newline at end of file