blob: a346cb57a913b8d66eccba7bc11b52ad66e933c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
|