blob: 16931fb7d0007a12e82768c8527ab7dde0ef7f2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('cert_file', [
'rootCA.crt'
])
def test_cert_file_installed(host, cert_file):
os = host.system_info.distribution
if (os == "centos"):
f = host.file('/etc/pki/ca-trust/source/anchors/' + cert_file)
if (os == "ubuntu"):
f = host.file('/usr/local/share/ca-certificates/' + cert_file)
assert f.exists
assert f.user == 'root'
assert f.group == 'root'
|