summaryrefslogtreecommitdiffstats
path: root/ansible/roles/firewall/molecule/default/tests/test_default.py
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/firewall/molecule/default/tests/test_default.py')
-rw-r--r--ansible/roles/firewall/molecule/default/tests/test_default.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/ansible/roles/firewall/molecule/default/tests/test_default.py b/ansible/roles/firewall/molecule/default/tests/test_default.py
new file mode 100644
index 00000000..a346cb57
--- /dev/null
+++ b/ansible/roles/firewall/molecule/default/tests/test_default.py
@@ -0,0 +1,18 @@
+import os
+
+import testinfra.utils.ansible_runner
+
+testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
+ os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
+
+
+def test_firewall_service_disabled(host):
+ distribution = host.system_info.distribution
+ if distribution == "centos":
+ svc = "firewalld"
+ elif distribution == "ubuntu":
+ svc = "ufw"
+ service = host.service(svc)
+
+ assert not service.is_running
+ assert not service.is_enabled