manage_netplan/molecule/default/tests/test_default.py

19 lines
547 B
Python
Raw Normal View History

2023-04-11 21:32:34 +00:00
"""Role testing files using testinfra."""
def test_hosts_file(host):
"""Validate /etc/hosts file."""
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
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