コード例 #1
0
 def test_08_publish_repo(self):
     distributor_facade = IsoDistributor.from_role(self.repo_role)
     response = self.repo.publish(
         self.pulp,
         distributor_facade.distributor_id
     )
     self.assertPulp(code=202)
     Task.wait_for_report(self.pulp, response)
コード例 #2
0
 def setUpClass(cls):
     super(IsoRepoTest, cls).setUpClass()
     # FIXME hardwired repo role
     repo = {
         'id': cls.__name__ + '_repo',
         'feed': DEFAULT_FEED,
         'proxy': ROLES.get('proxy'),
     }
     cls.repo, cls.importer1, [cls.distributor1
                               ] = IsoRepo.from_role(repo).create(cls.pulp)
     importer = IsoImporter(feed=None)
     distributors1 = [IsoDistributor(relative_url='xyz')]
     distributors2 = [IsoDistributor(relative_url='zyx')]
     cls.repo_copy, cls.importer_copy, [cls.distributor_copy] = IsoRepo(
         id=cls.__name__ + "_repo_copy",
         importer=importer,
         distributors=distributors1).create(cls.pulp)
     cls.repo_upload, cls.importer_upload, [
         cls.distributor_upload
     ] = IsoRepo(id=cls.__name__ + "_repo_upload",
                 importer=importer,
                 distributors=distributors2).create(cls.pulp)
コード例 #3
0
 def test_06_associate_distributor(self):
     distributor_facade = IsoDistributor.from_role(self.repo_role)
     response = self.repo.associate_distributor(
         self.pulp, data=distributor_facade.as_data())
     self.assertPulp(code=201)
     distributor = Distributor.from_response(response)
     self.assertEqual(
         distributor, {
             'id': distributor_facade.distributor_id,
             'distributor_type_id': distributor_facade.distributor_type_id,
             'repo_id': self.repo.id,
             'config': distributor_facade.distributor_config,
             'last_publish': None,
             'auto_publish': distributor_facade.auto_publish,
         })
コード例 #4
0
 def test_06_associate_distributor(self):
     distributor_facade = IsoDistributor.from_role(self.repo_role)
     response = self.repo.associate_distributor(self.pulp, data=distributor_facade.as_data())
     self.assertPulp(code=201)
     distributor = Distributor.from_response(response)
     self.assertEqual(
         distributor,
         {
             'id': distributor_facade.distributor_id,
             'distributor_type_id': distributor_facade.distributor_type_id,
             'repo_id': self.repo.id,
             'config': distributor_facade.distributor_config,
             'last_publish': None,
             'auto_publish': distributor_facade.auto_publish,
         }
     )
コード例 #5
0
 def setUpClass(cls):
     super(IsoCopyRepoTest, cls).setUpClass()
     # FIXME: hardwired role
     repo = {
         'id': cls.__name__,
         'feed': DEFAULT_FEED,
         'proxy': ROLES.get('proxy'),
     }
     # create source repo and sync it to have modules fetched
     cls.source_repo, _, _ = IsoRepo.from_role(repo).create(cls.pulp)
     Task.wait_for_report(cls.pulp, cls.source_repo.sync(cls.pulp))
     # create two destinations repos for copy purpose
     importer = IsoImporter(feed=None)
     distributors = [IsoDistributor(relative_url='xyz')]
     cls.dest_repo1, _, _ = IsoRepo(id=cls.__name__ + '1',
                                    importer=importer,
                                    distributors=distributors).create(
                                        cls.pulp)
     cls.dest_repo2, _, _ = IsoRepo(id=cls.__name__ + '2',
                                    importer=importer,
                                    distributors=distributors).create(
                                        cls.pulp)
コード例 #6
0
 def test_08_publish_repo(self):
     distributor_facade = IsoDistributor.from_role(self.repo_role)
     response = self.repo.publish(self.pulp,
                                  distributor_facade.distributor_id)
     self.assertPulp(code=202)
     Task.wait_for_report(self.pulp, response)