Skip to content

Commit

Permalink
firewalld: Correct usage of queryForwardPort
Browse files Browse the repository at this point in the history
* Correct queryForwardPort API usage
* Enable port_foward_test_cases tests

Fixes: ansible-collections#247

Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde committed Aug 16, 2021
1 parent ab9eaf2 commit e4a325b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/modules/firewalld.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/targets/firewalld/tasks/run_all_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- include_tasks: zone_target_test_cases.yml

# firewalld port forwarding operation test cases
- include_tasks: port_foward_test_cases.yml

0 comments on commit e4a325b

Please sign in to comment.