def test_positive_schedule_Entitlements_report(self): """Schedule an report using the Subscription - Entitlement Report template in csv format. :id: 572fb387-86e0-40e2-b2df-e8ec26433610 :setup: Installed Satellite with Organization, Activation key, Content View, Content Host, and Subscriptions. :steps: 1. hammer report-template schedule --organization '' --id '' --report-format '' :expectedresults: report is scheduled and generated containing all the expected information regarding entitlements. :CaseImportance: High """ with VirtualMachine(distro=DISTRO_RHEL7) as vm: vm.install_katello_ca() vm.register_contenthost(self.setup_org['label'], self.setup_new_ak['name']) assert vm.subscribed scheduled_csv = ReportTemplate.schedule({ 'name': 'Subscription - Entitlement Report', 'organization': self.setup_org['name'], 'report-format': 'csv', 'inputs': 'Days from Now=no limit', }) data_csv = ReportTemplate.report_data({ 'name': 'Subscription - Entitlement Report', 'job-id': scheduled_csv[0].split("Job ID: ", 1)[1], }) assert any(vm.hostname in line for line in data_csv) assert any(self.setup_subs_id[0]['name'] in line for line in data_csv)
def test_positive_schedule_entitlements_report(local_org, local_ak, local_subscription, rhel7_contenthost, target_sat): """Schedule an report using the Subscription - Entitlement Report template in csv format. :id: 572fb387-86e0-40e2-b2df-e8ec26433610 :setup: Installed Satellite with Organization, Activation key, Content View, Content Host, and Subscriptions. :steps: 1. hammer report-template schedule --organization '' --id '' --report-format '' :expectedresults: report is scheduled and generated containing all the expected information regarding entitlements. :parametrized: yes """ client = rhel7_contenthost client.install_katello_ca(target_sat) client.register_contenthost(local_org['label'], local_ak['name']) assert client.subscribed scheduled_csv = ReportTemplate.schedule({ 'name': 'Subscription - Entitlement Report', 'organization': local_org['name'], 'report-format': 'csv', 'inputs': 'Days from Now=no limit', }) data_csv = ReportTemplate.report_data({ 'name': 'Subscription - Entitlement Report', 'job-id': scheduled_csv.split('\n', 1)[0].split('Job ID: ', 1)[1], }) assert client.hostname in data_csv assert local_subscription['name'] in data_csv