2023-04-11 21:32:34 +00:00
|
|
|
"""Role testing files using testinfra."""
|
|
|
|
|
|
|
|
|
|
|
|
def test_hosts_file(host):
|
|
|
|
"""Validate /etc/hosts file."""
|
2023-04-15 12:50:25 +00:00
|
|
|
etc_hosts = host.file("/etc/hosts")
|
|
|
|
assert etc_hosts.exists
|
|
|
|
assert etc_hosts.user == "root"
|
|
|
|
assert etc_hosts.group == "root"
|
2023-04-11 21:32:34 +00:00
|
|
|
|
2023-04-15 12:50:25 +00:00
|
|
|
def test_netplan_storage(host):
|
|
|
|
"""Validate /etc/netplan directory."""
|
|
|
|
etc_netplan = host.file("/etc/netplan")
|
|
|
|
assert etc_netplan.exists
|
|
|
|
assert etc_netplan.is_directory
|
|
|
|
assert etc_netplan.user == "root"
|
|
|
|
assert etc_netplan.group =="root"
|
|
|
|
assert etc_netplan.mode == 0o755
|