2019-05-26 15:43:37 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
import testinfra.utils.ansible_runner
|
|
|
|
|
|
|
|
import warnings
|
|
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
|
|
|
|
|
|
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|
|
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
|
|
|
|
|
|
|
|
|
|
|
def test_yum_cron_is_installed(host):
|
|
|
|
yum = host.package("yum-cron")
|
|
|
|
assert yum.is_installed
|
|
|
|
|
2019-06-09 11:39:19 +00:00
|
|
|
|
2019-05-26 15:43:37 +00:00
|
|
|
def test_yum_running_and_enabled(host):
|
|
|
|
yum = host.service("yum-cron")
|
|
|
|
assert yum.is_running
|
|
|
|
assert yum.is_enabled
|