Example #1
0
def test_negative_check_hammer_ping_assumeyes(ansible_module):
    """Verify hammer ping check once failed restart the services

    :id:

    :setup:
        1. foreman-maintain should be installed.

    :steps:
        1. Run Katello-service stop
        2. Run foreman-maintain health check --label hammer-ping --assumeyes

    :expectedresults: Health check should perform.

    :CaseImportance: Critical
    """
    setup = ansible_module.command(Advanced.run_katello_service_stop())
    for result in setup.values():
        print(result['stdout'])
    contacted = ansible_module.command(
        Health.check({'label': 'hammer-ping'}) + ' -y')
    for result in contacted.values():
        print(result)
        assert "FAIL" in result['stdout']
    verify = ansible_module.command(
        "systemctl is-active foreman-tasks.service")
    for result in verify.values():
        assert "inactive" not in result['stdout']
Example #2
0
def test_negative_check_hammer_ping(ansible_module):
    """Verify hammer ping check

    :id:

    :setup:
        1. foreman-maintain should be installed.

    :steps:
        1. Run Katello-service stop
        2. Run foreman-maintain health check --label hammer-ping
        3. Run Katello-service start

    :expectedresults: Health check should perform.

    :CaseImportance: Critical
    """
    setup = ansible_module.command(Advanced.run_katello_service_stop())
    for result in setup.values():
        assert result['rc'] == 0
    contacted = ansible_module.command(Health.check({'label': 'hammer-ping'}))
    for result in contacted.values():
        print(result['stdout'])
        assert "FAIL" in result['stdout']
    teardown = ansible_module.command(Advanced.run_katello_service_start())
    for result in teardown.values():
        print(result['stdout'])