diff --git a/molecule/default/tests/__pycache__/conftest.cpython-310.pyc b/molecule/default/tests/__pycache__/conftest.cpython-310.pyc deleted file mode 100644 index fb63538..0000000 Binary files a/molecule/default/tests/__pycache__/conftest.cpython-310.pyc and /dev/null differ diff --git a/molecule/default/tests/__pycache__/test_default.cpython-310.pyc b/molecule/default/tests/__pycache__/test_default.cpython-310.pyc deleted file mode 100644 index 5f59100..0000000 Binary files a/molecule/default/tests/__pycache__/test_default.cpython-310.pyc and /dev/null differ diff --git a/molecule/default/tests/conftest.py b/molecule/default/tests/conftest.py deleted file mode 100644 index f7ddb3f..0000000 --- a/molecule/default/tests/conftest.py +++ /dev/null @@ -1,22 +0,0 @@ -"""PyTest Fixtures.""" -from __future__ import absolute_import - -import os - -import pytest - - -def pytest_runtest_setup(item): - """Run tests only when under molecule with testinfra installed.""" - try: - import testinfra - except ImportError: - pytest.skip("Test requires testinfra", allow_module_level=True) - if "MOLECULE_INVENTORY_FILE" in os.environ: - pytest.testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ["MOLECULE_INVENTORY_FILE"] - ).get_hosts("all") - else: - pytest.skip( - "Test should run only from inside molecule.", allow_module_level=True - ) diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py deleted file mode 100644 index cc481f0..0000000 --- a/molecule/default/tests/test_default.py +++ /dev/null @@ -1,27 +0,0 @@ -"""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" - -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 - -def test_netplan_config_file(host): - """Validate netplan config file.""" - etc_netplan_config = host.file("/etc/netplan/ansible-config.yaml") - assert etc_netplan_config.exists - assert etc_netplan_config.user == "root" - assert etc_netplan_config.group == "root" - assert etc_netplan_config.mode == 0o644 - assert etc_netplan_config.content_string != "" diff --git a/molecule/with_custom_config/tests/conftest.py b/molecule/with_custom_config/tests/conftest.py deleted file mode 100644 index f7ddb3f..0000000 --- a/molecule/with_custom_config/tests/conftest.py +++ /dev/null @@ -1,22 +0,0 @@ -"""PyTest Fixtures.""" -from __future__ import absolute_import - -import os - -import pytest - - -def pytest_runtest_setup(item): - """Run tests only when under molecule with testinfra installed.""" - try: - import testinfra - except ImportError: - pytest.skip("Test requires testinfra", allow_module_level=True) - if "MOLECULE_INVENTORY_FILE" in os.environ: - pytest.testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ["MOLECULE_INVENTORY_FILE"] - ).get_hosts("all") - else: - pytest.skip( - "Test should run only from inside molecule.", allow_module_level=True - ) diff --git a/molecule/with_custom_config/tests/test_default.py b/molecule/with_custom_config/tests/test_default.py deleted file mode 100644 index 4d46981..0000000 --- a/molecule/with_custom_config/tests/test_default.py +++ /dev/null @@ -1,27 +0,0 @@ -"""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" - -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 - -def test_netplan_config_file(host): - """Validate netplan config file.""" - etc_netplan_config = host.file("/tmp/ansible-config.yaml") - assert etc_netplan_config.exists - assert etc_netplan_config.user == "root" - assert etc_netplan_config.group == "root" - assert etc_netplan_config.mode == 0o644 - assert etc_netplan_config.content_string != ""