def setUpClass(cls): super(PublishGroupTest, cls).setUpClass() # create repo_group repo_group = RepoGroup(data={'id': cls.__name__ + "_repo_group"}) response = repo_group.create(cls.pulp) cls.repo_group = RepoGroup.from_response(response) cls.repo_group1 = RepoGroup(data={'id': cls.__name__ + "_repo_group1"}) #associate_distributor with cls.pulp.asserting(True): response = cls.repo_group.associate_distributor( cls.pulp, data={ 'distributor_type_id': 'group_export_distributor', 'distributor_config': { 'http': False, 'https': False }, 'distributor_id': 'dist_1' }) cls.distributor = GroupDistributor.from_response(response) #create repo repo_config = [repo for repo in ROLES.repos if repo.type == 'rpm'][0] cls.repo, _, _ = create_yum_repo(cls.pulp, **repo_config) Task.wait_for_report(cls.pulp, cls.repo.sync(cls.pulp))
def setUpClass(cls): super(PublishGroupTest, cls).setUpClass() # create repo_group repo_group=RepoGroup(data={'id': cls.__name__ + "_repo_group"}) response=repo_group.create(cls.pulp) cls.repo_group = RepoGroup.from_response(response) cls.repo_group1 = RepoGroup(data={'id': cls.__name__ + "_repo_group1"}) #associate_distributor with cls.pulp.asserting(True): response = cls.repo_group.associate_distributor( cls.pulp, data={ 'distributor_type_id': 'group_export_distributor', 'distributor_config': { 'http': False, 'https': False }, 'distributor_id': 'dist_1' } ) cls.distributor = GroupDistributor.from_response(response) #create repo repo_config = [repo for repo in ROLES.repos if repo.type == 'rpm'][0] cls.repo, importer, [distributor] = YumRepo.from_role(repo_config).create(cls.pulp) Task.wait_for_report(cls.pulp, cls.repo.sync(cls.pulp))
def setUpClass(cls): super(RepoGroupTest, cls).setUpClass() cls.repo = Repo(data={'id': cls.__name__ + "_repo"}) cls.repo2 = Repo(data={'id': cls.__name__ + "_repo2"}) cls.repo_group = RepoGroup(data={'id': cls.__name__ + "_repo_group"}) cls.repo_group1 = RepoGroup(data={'id': cls.__name__ + "_repo_group1"}) cls.repo_group2 = RepoGroup(data={'id': cls.__name__ + "_repo_group2", 'repo_ids': [cls.repo.id]}) cls.repo_group3 = RepoGroup(data={'id': cls.__name__ + "_repo_group3", 'repo_ids': [cls.repo2.id]}) cls.feed = 'http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/'
def setUpClass(cls): super(RepoGroupTest, cls).setUpClass() cls.repo = Repo(data={'id': cls.__name__ + "_repo"}) cls.repo2 = Repo(data={'id': cls.__name__ + "_repo2"}) cls.repo_group = RepoGroup(data={'id': cls.__name__ + "_repo_group"}) cls.repo_group1 = RepoGroup(data={'id': cls.__name__ + "_repo_group1"}) cls.repo_group2 = RepoGroup(data={ 'id': cls.__name__ + "_repo_group2", 'repo_ids': [cls.repo.id] }) cls.repo_group3 = RepoGroup(data={ 'id': cls.__name__ + "_repo_group3", 'repo_ids': [cls.repo2.id] })
def test_05_update_group(self): display_name = 'A %s group' % self.__class__.__name__ self.repo_group.update(self.pulp, {'display_name': display_name}) self.assertPulp(code=200) self.assertEqual( RepoGroup.get(self.pulp, self.repo_group.id).data['display_name'], display_name)
def setUpClass(cls): super(DistributorGroupTest, cls).setUpClass() # create repo_group repo_group = RepoGroup(data={'id': cls.__name__ + "_repo_group"}) response = repo_group.create(cls.pulp) cls.repo_group = RepoGroup.from_response(response) cls.repo_group1 = RepoGroup(data={'id': cls.__name__ + "_repo_group1"}) #associate_distributor with cls.pulp.asserting(True): response = cls.repo_group.associate_distributor( cls.pulp, data={ 'distributor_type_id': 'group_export_distributor', 'distributor_config': { 'http': False, 'https': False }, 'distributor_id': 'dist_1' }) cls.distributor = GroupDistributor.from_response(response)
def setUpClass(cls): super(DistributorGroupTest, cls).setUpClass() # create repo_group repo_group=RepoGroup(data={'id': cls.__name__ + "_repo_group"}) response=repo_group.create(cls.pulp) cls.repo_group = RepoGroup.from_response(response) cls.repo_group1 = RepoGroup(data={'id': cls.__name__ + "_repo_group1"}) #associate_distributor with cls.pulp.asserting(True): response = cls.repo_group.associate_distributor( cls.pulp, data={ 'distributor_type_id': 'group_export_distributor', 'distributor_config': { 'http': False, 'https': False }, 'distributor_id': 'dist_1' } ) cls.distributor = GroupDistributor.from_response(response)
def setUpClass(cls): super(PublishGroupTest, cls).setUpClass() # create repo_group repo_group = RepoGroup(data={"id": cls.__name__ + "_repo_group"}) response = repo_group.create(cls.pulp) cls.repo_group = RepoGroup.from_response(response) cls.repo_group1 = RepoGroup(data={"id": cls.__name__ + "_repo_group1"}) # associate_distributor with cls.pulp.asserting(True): response = cls.repo_group.associate_distributor( cls.pulp, data={ "distributor_type_id": "group_export_distributor", "distributor_config": {"http": False, "https": False}, "distributor_id": "dist_1", }, ) cls.distributor = GroupDistributor.from_response(response) # create repo repo_config = [repo for repo in ROLES.repos if repo.type == "rpm"][0] cls.repo, _, _ = create_yum_repo(cls.pulp, **repo_config) Task.wait_for_report(cls.pulp, cls.repo.sync(cls.pulp))
def test_10_list_repo_groups(self): repo_groups = RepoGroup.list(self.pulp) repo_group = RepoGroup.get(self.pulp, self.repo_group.id) self.assertPulp(code=200) self.assertIn(repo_group, repo_groups)
def test_09_get_unexistant_group(self): with self.assertRaises(AssertionError): RepoGroup.get(self.pulp, 'some_id') self.assertPulp(code=404)
def test_08_get_repo_group(self): repo_group = RepoGroup.get(self.pulp, self.repo_group.id) self.assertPulp(code=200) self.assertEqual(repo_group.id, self.repo_group.id)
def test_06_no_repo_ids_update_group(self): # check you cannot update repo_ids in this call self.repo_group.update(self.pulp, {'repo_ids': ['another_repo']}) self.assertPulp(code=400) self.assertEqual(RepoGroup.get(self.pulp, self.repo_group.id).data['repo_ids'], [])
def test_05_update_group(self): display_name = 'A %s group' % self.__class__.__name__ self.repo_group.update(self.pulp, {'display_name': display_name}) self.assertPulp(code=200) self.assertEqual(RepoGroup.get(self.pulp, self.repo_group.id).data['display_name'], display_name)
def test_06_no_repo_ids_update_group(self): # check you cannot update repo_ids in this call self.repo_group.update(self.pulp, {'repo_ids': ['another_repo']}) self.assertPulp(code=400) self.assertEqual( RepoGroup.get(self.pulp, self.repo_group.id).data['repo_ids'], [])