Пример #1
0
def test_negative_check_hammer_ping(ansible_module):
    """Verify hammer ping check

    :id: ecdc5bfb-2adf-49f6-948d-995dae34bcd3

    :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():
        logger.info(result['stdout'])
        assert "FAIL" in result['stdout']
    teardown = ansible_module.command(Advanced.run_service_start())
    for result in teardown.values():
        logger.info(result['stdout'])
Пример #2
0
def setup_katello_service_stop(request, ansible_module):
    """This fixture is used to stop/start katello services.
    It is used by test test_negative_check_server_ping of test_health.py.
    """
    setup = ansible_module.command(Advanced.run_katello_service_stop())
    for result in setup.values():
        assert result["rc"] == 0

    def teardown_katello_service_start():
        teardown = ansible_module.command(Advanced.run_service_start())
        for result in teardown.values():
            logger.info(result["stdout"])
            assert result["rc"] == 0

    request.addfinalizer(teardown_katello_service_start)