remove python tests
All checks were successful
test / Linting (push) Successful in 26s
test / Molecule tests (default, debian11) (push) Successful in 1m40s
test / Molecule tests (default, ubuntu2004) (push) Successful in 1m42s
test / Molecule tests (default, debian12) (push) Successful in 1m59s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m28s
test / Molecule tests (with_custom_ascii, debian11) (push) Successful in 1m22s
test / Molecule tests (with_custom_ascii, debian12) (push) Successful in 1m15s
test / Molecule tests (with_custom_ascii, ubuntu2004) (push) Successful in 1m22s
test / Molecule tests (with_custom_ascii, ubuntu2204) (push) Successful in 1m37s
All checks were successful
test / Linting (push) Successful in 26s
test / Molecule tests (default, debian11) (push) Successful in 1m40s
test / Molecule tests (default, ubuntu2004) (push) Successful in 1m42s
test / Molecule tests (default, debian12) (push) Successful in 1m59s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m28s
test / Molecule tests (with_custom_ascii, debian11) (push) Successful in 1m22s
test / Molecule tests (with_custom_ascii, debian12) (push) Successful in 1m15s
test / Molecule tests (with_custom_ascii, ubuntu2004) (push) Successful in 1m22s
test / Molecule tests (with_custom_ascii, ubuntu2204) (push) Successful in 1m37s
This commit is contained in:
parent
e1a216a90e
commit
c180b00c03
@ -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
|
||||
)
|
@ -1,30 +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_motd_file(host):
|
||||
"""Validate motd.cfg file."""
|
||||
motd_cfg = host.file("/etc/profile.d/motd.cfg")
|
||||
dist_os = host.system_info.distribution
|
||||
assert motd_cfg.exists
|
||||
assert motd_cfg.user == "root"
|
||||
assert motd_cfg.group == "root"
|
||||
assert motd_cfg.mode == 0o644
|
||||
assert motd_cfg.contains("print_info()")
|
||||
assert motd_cfg.contains("ascii_distro=\"" + dist_os + "_small\"")
|
||||
|
||||
def test_motd_file(host):
|
||||
"""Validate 00-motd-neofetch file."""
|
||||
motd_neofetch = host.file("/etc/update-motd.d/00-motd-neofetch")
|
||||
assert motd_neofetch.exists
|
||||
assert motd_neofetch.user == "root"
|
||||
assert motd_neofetch.group == "root"
|
||||
assert motd_neofetch.mode == 0o744
|
||||
assert motd_neofetch.contains("#! /bin/sh")
|
||||
assert motd_neofetch.contains("neofetch --config /etc/profile.d/motd.cfg")
|
@ -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
|
||||
)
|
@ -1,28 +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_motd_file(host):
|
||||
"""Validate motd.cfg file."""
|
||||
motd_cfg = host.file("/etc/profile.d/motd.cfg")
|
||||
assert motd_cfg.exists
|
||||
assert motd_cfg.user == "root"
|
||||
assert motd_cfg.group == "root"
|
||||
assert motd_cfg.mode == 0o644
|
||||
assert motd_cfg.contains("print_info()")
|
||||
|
||||
def test_motd_file(host):
|
||||
"""Validate 00-motd-neofetch file."""
|
||||
motd_neofetch = host.file("/etc/update-motd.d/00-motd-neofetch")
|
||||
assert motd_neofetch.exists
|
||||
assert motd_neofetch.user == "root"
|
||||
assert motd_neofetch.group == "root"
|
||||
assert motd_neofetch.mode == 0o744
|
||||
assert motd_neofetch.contains("#! /bin/sh")
|
||||
assert motd_neofetch.contains("neofetch --config /etc/profile.d/motd.cfg")
|
Loading…
Reference in New Issue
Block a user