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'])
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