def test_repositoryset_disable_by_id(self): """@Test: Disable repo from reposet by IDs of reposet, org and product @Feature: Repository-set @Assert: Repository was disabled """ org = make_org() manifest = manifests.clone() upload_file(manifest, remote_file=manifest) result = Subscription.upload({ u'file': manifest, u'organization-id': org['id'], }) self.assertEqual(result.return_code, 0) product_id = Product.info({ u'name': PRDS['rhel'], u'organization-id': org['id'], }).stdout['id'] reposet_id = RepositorySet.info({ u'name': REPOSET['rhva6'], u'organization-id': org['id'], u'product-id': product_id, }).stdout['id'] result = RepositorySet.enable({ u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, u'releasever': '6Server', u'basearch': 'x86_64', }) self.assertEqual(result.return_code, 0) result = RepositorySet.disable({ u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, u'releasever': '6Server', u'basearch': 'x86_64', }) self.assertEqual(result.return_code, 0) result = RepositorySet.available_repositories({ u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, }) self.assertEqual(result.return_code, 0) enabled = [ repo['enabled'] for repo in result.stdout if repo['arch'] == 'x86_64' and repo['release'] == '6Server' ][0] self.assertEqual(enabled, 'false')
def test_positive_disable_by_id(self): """Disable repo from reposet by IDs of reposet, org and product :id: 0d6102ba-3fb9-4eb8-972e-d537e252a8e6 :expectedresults: Repository was disabled :CaseImportance: Critical """ org = make_org() with manifests.clone() as manifest: upload_file(manifest.content, manifest.filename) Subscription.upload({ u'file': manifest.filename, u'organization-id': org['id'], }) product_id = Product.info({ u'name': PRDS['rhel'], u'organization-id': org['id'], })['id'] reposet_id = RepositorySet.info({ u'name': REPOSET['rhva6'], u'organization-id': org['id'], u'product-id': product_id, })['id'] RepositorySet.enable({ u'basearch': 'x86_64', u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, u'releasever': '6Server', }) RepositorySet.disable({ u'basearch': 'x86_64', u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, u'releasever': '6Server', }) result = RepositorySet.available_repositories({ u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, }) enabled = [ repo['enabled'] for repo in result if repo['arch'] == 'x86_64' and repo['release'] == '6Server' ][0] self.assertEqual(enabled, 'false')
def test_positive_disable_by_id(self): """@Test: Disable repo from reposet by IDs of reposet, org and product @Feature: Repository-set @Assert: Repository was disabled """ org = make_org() with manifests.clone() as manifest: upload_file(manifest.content, manifest.filename) Subscription.upload({ u'file': manifest.filename, u'organization-id': org['id'], }) product_id = Product.info({ u'name': PRDS['rhel'], u'organization-id': org['id'], })['id'] reposet_id = RepositorySet.info({ u'name': REPOSET['rhva6'], u'organization-id': org['id'], u'product-id': product_id, })['id'] RepositorySet.enable({ u'basearch': 'x86_64', u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, u'releasever': '6Server', }) RepositorySet.disable({ u'basearch': 'x86_64', u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, u'releasever': '6Server', }) result = RepositorySet.available_repositories({ u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, }) enabled = [ repo['enabled'] for repo in result if repo['arch'] == 'x86_64' and repo['release'] == '6Server' ][0] self.assertEqual(enabled, 'false')
def test_positive_enable_by_id(self): """Enable repo from reposet by IDs of reposet, org and product :id: f7c88534-1d45-45d9-9b87-c50c4e268e8d :expectedresults: Repository was enabled :CaseImportance: Critical """ org = make_org() with manifests.clone() as manifest: upload_file(manifest.content, manifest.filename) Subscription.upload({ 'file': manifest.filename, 'organization-id': org['id'] }) product_id = Product.info({ 'name': PRDS['rhel'], 'organization-id': org['id'] })['id'] reposet_id = RepositorySet.info({ 'name': REPOSET['rhva6'], 'organization-id': org['id'], 'product-id': product_id })['id'] RepositorySet.enable({ 'basearch': 'x86_64', 'id': reposet_id, 'organization-id': org['id'], 'product-id': product_id, 'releasever': '6Server', }) result = RepositorySet.available_repositories({ 'id': reposet_id, 'organization-id': org['id'], 'product-id': product_id }) enabled = [ repo['enabled'] for repo in result if repo['arch'] == 'x86_64' and repo['release'] == '6Server' ][0] self.assertEqual(enabled, 'true')
def test_positive_enable_by_id(self): """Enable repo from reposet by IDs of reposet, org and product @Feature: Repository-set @Assert: Repository was enabled """ org = make_org() with manifests.clone() as manifest: upload_file(manifest.content, manifest.filename) Subscription.upload({ u'file': manifest.filename, u'organization-id': org['id'], }) product_id = Product.info({ u'name': PRDS['rhel'], u'organization-id': org['id'], })['id'] reposet_id = RepositorySet.info({ u'name': REPOSET['rhva6'], u'organization-id': org['id'], u'product-id': product_id, })['id'] RepositorySet.enable({ u'basearch': 'x86_64', u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, u'releasever': '6Server', }) result = RepositorySet.available_repositories({ u'id': reposet_id, u'organization-id': org['id'], u'product-id': product_id, }) enabled = [ repo['enabled'] for repo in result if repo['arch'] == 'x86_64' and repo['release'] == '6Server' ][0] self.assertEqual(enabled, 'true')
def params(manifest_org): PRODUCT_NAME = PRDS['rhel'] REPOSET_NAME = REPOSET['rhva6'] ARCH = 'x86_64' ARCH_2 = 'i386' RELEASE = '6Server' product_id = Product.info({'name': PRODUCT_NAME, 'organization-id': manifest_org['id']})['id'] reposet_id = RepositorySet.info( {'name': REPOSET_NAME, 'organization-id': manifest_org['id'], 'product-id': product_id} )['id'] avail = { 'id': { 'name': REPOSET_NAME, 'organization-id': manifest_org['id'], 'product': PRODUCT_NAME, }, 'ids': { 'id': reposet_id, 'organization-id': manifest_org['id'], 'product-id': product_id, }, 'label': { 'name': REPOSET_NAME, 'organization-label': manifest_org['label'], 'product': PRODUCT_NAME, }, 'name': { 'name': REPOSET_NAME, 'organization': manifest_org['name'], 'product': PRODUCT_NAME, }, } enable = { 'arch_2': { 'basearch': ARCH_2, 'name': REPOSET_NAME, 'organization-id': manifest_org['id'], 'product': PRODUCT_NAME, 'releasever': RELEASE, }, 'id': { 'basearch': ARCH, 'name': REPOSET_NAME, 'organization-id': manifest_org['id'], 'product': PRODUCT_NAME, 'releasever': RELEASE, }, 'ids': { 'basearch': ARCH, 'id': reposet_id, 'organization-id': manifest_org['id'], 'product-id': product_id, 'releasever': RELEASE, }, 'label': { 'basearch': ARCH, 'name': REPOSET_NAME, 'organization-label': manifest_org['label'], 'product': PRODUCT_NAME, 'releasever': RELEASE, }, 'name': { 'basearch': ARCH, 'name': REPOSET_NAME, 'organization': manifest_org['name'], 'product': PRODUCT_NAME, 'releasever': RELEASE, }, } match = { 'enabled': {'enabled': 'true'}, 'enabled_arch_rel': {'enabled': 'true', 'arch': ARCH, 'release': RELEASE}, } return {'enable': enable, 'avail': avail, 'match': match}