def test_positive_remove_job_file(setup_subscribe_to_cdn_dogfood, ansible_module): """Verify file /var/lib/pulp/job1.0.0 is not present after the following command. :id: eed224f9-a2ec-4d15-9047-cede0b823866 :setup: 1. foreman-maintain should be installed. :steps: 1. Run foreman-maintain health list --tags pre-upgrade 2. Run foreman-maintain health check --label disk-performance :expectedresults: `disk-performance` shouldn't exist under pre-upgrade tag and /var/lib/pulp/job1.0.0 file should not exist after check execution :CaseImportance: Medium :BZ: 1827219, 1762302 """ # Verify pre-upgrade checks don't include disk-performance check contacted = ansible_module.command(Health.list({"tags": "pre-upgrade"})) for result in contacted.values(): assert "disk-performance" not in result["stdout"] # Verify job1.0.0 file not exist after check completion contacted = ansible_module.command(Health.check(["--label", "disk-performance", "--assumeyes"])) contacted = ansible_module.find(paths="/var/lib/pulp", file_type="file") for file in contacted.values()[0]["files"]: assert "job" not in file["path"]
def test_positive_foreman_maintain_health_list(ansible_module): """List health check in foreman-maintain :id: 976ef4cd-e028-4545-91bb-72433d40d7ee :setup: 1. foreman-maintain should be installed. :steps: 1. Run foreman-maintain health list :expectedresults: Health check list should work. :CaseImportance: Critical """ contacted = ansible_module.command(Health.list()) for result in contacted.values(): logger.info(result['stdout']) assert result["rc"] == 0
def test_positive_foreman_maintain_health_list(ansible_module): """List health check in foreman-maintain :id: 976ef4cd-e028-4545-91bb-72433d40d7ee :setup: 1. foreman-maintain should be installed. :steps: 1. Run foreman-maintain health list :expectedresults: Health check list should work. :CaseImportance: Critical """ contacted = ansible_module.command(Health.list()) for result in contacted.values(): logger.info(result["stdout"]) assert result["rc"] == 0
def test_positive_list_health_check_by_tags(ansible_module): """List health check in foreman-maintain by tags :id: 420d8e62-84d8-4496-8c24-037bd23febe9 :setup: 1. foreman-maintain should be installed. :steps: 1. Run foreman-maintain health list --tags default :expectedresults: health checks according to tag should list. :CaseImportance: Critical """ for tags in ["default", "pre-upgrade"]: contacted = ansible_module.command(Health.list({"tags": tags})) for result in contacted.values(): logger.info(result["stdout"]) assert result["rc"] == 0
def test_positive_list_health_check_by_tags(ansible_module): """List health check in foreman-maintain by tags :id: 420d8e62-84d8-4496-8c24-037bd23febe9 :setup: 1. foreman-maintain should be installed. :steps: 1. Run foreman-maintain health list --tags default :expectedresults: health checks according to tag should list. :CaseImportance: Critical """ for tags in ['default', 'pre-upgrade']: contacted = ansible_module.command(Health.list({ 'tags': tags })) for result in contacted.values(): logger.info(result['stdout']) assert result["rc"] == 0