Exemple #1
0
    def setUpClass(cls):
        super(SimpleRepoCopyTest, cls).setUpClass()
        #Destination repo
        # make sure repos don't exist
        # no need to wait for repos.delete to happen
        feed = None
        dest_repo_name = cls.__name__ + '_copy'
        dest_repo1 = Repo({'id': dest_repo_name})
        dest_repo1.delete(cls.pulp)
        cls.dest_repo1, _, _ = create_yum_repo(cls.pulp, dest_repo_name, feed)

        #2nd Destination Repo
        dest_repo_name = cls.__name__ + '_copy1'
        dest_repo2 = Repo({'id': dest_repo_name})
        dest_repo2.delete(cls.pulp)
        cls.dest_repo2, _, _ = create_yum_repo(cls.pulp, dest_repo_name, feed)

        # Source repo
        default_repo_config = [
            repo for repo in ROLES.repos if repo.type == 'rpm'
        ][0]
        source_repo_name = cls.__name__ + '_repo'
        source_repo = Repo({'id': source_repo_name})
        source_repo.delete(cls.pulp)
        cls.source_repo, _, _ = create_yum_repo(cls.pulp, source_repo_name,
                                                default_repo_config.feed)
        Task.wait_for_report(cls.pulp, cls.source_repo.sync(cls.pulp))
    def setUpClass(cls):
        super(SimpleRepoCopyTest, cls).setUpClass()
        #Destination repo
        # make sure repos don't exist
        # no need to wait for repos.delete to happen
        dest_repo_name = cls.__name__ + '_copy'
        dest_repo1 = Repo({'id': dest_repo_name})
        dest_repo1.delete(cls.pulp)
        cls.dest_repo1, _, _ = YumRepo(
            id=dest_repo_name,
            importer=YumImporter(None),
            distributors=[YumDistributor(relative_url='abc')]).create(cls.pulp)

        #2nd Destination Repo
        dest_repo_name = cls.__name__ + '_copy1'
        dest_repo2 = Repo({'id': dest_repo_name})
        dest_repo2.delete(cls.pulp)
        cls.dest_repo2, _, _ = YumRepo(
            id=dest_repo_name,
            importer=YumImporter(None),
            distributors=[YumDistributor(relative_url='xyz')]).create(cls.pulp)

        # Source repo
        default_repo_config = [
            repo for repo in ROLES.repos if repo.type == 'rpm'
        ][0]
        cls.source_repo, _, _ = YumRepo.from_role(default_repo_config).create(
            cls.pulp)
        Task.wait_for_report(cls.pulp, cls.source_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/'
Exemple #4
0
 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 setUpClass(cls):
     super(PuppetCopyRepoTest, cls).setUpClass()
     # this repo role is hardwired because of the search strings
     # refering to exact names as e.g. tomcat7_rhel
     # The proxy role is considered
     repo = {
         'id': cls.__name__,
         'feed': 'https://forge.puppetlabs.com',
         'queries': ['tomcat'],
         'proxy': ROLES.get('proxy'),
     }
     # create source repo and sync it to have modules fetched
     cls.source_repo, _, _ = PuppetRepo.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 = PuppetImporter(feed=None, queries=[])
     distributors = [PuppetDistributor()]
     cls.dest_repo1, _, _ = PuppetRepo(id=cls.__name__ + '1',
                                       importer=importer,
                                       distributors=distributors).create(
                                           cls.pulp)
     cls.dest_repo2, _, _ = PuppetRepo(id=cls.__name__ + '2',
                                       importer=importer,
                                       distributors=distributors).create(
                                           cls.pulp)
     # create data for repo
     cls.invalid_repo = Repo(data={'id': cls.__name__ + "_invalidrepo"})
     # create yum repo
     cls.yumrepo, _, _ = YumRepo(
         id=cls.__name__ + 'yum',
         importer=YumImporter(feed=None),
         distributors=[YumDistributor(relative_url='xyz')]).create(cls.pulp)
Exemple #6
0
 def tearDownClass(cls):
     with cls.pulp. async ():
         for repo_id in [
                 'SimpleRepoCopyTest_repo', 'SimpleRepoCopyTest_copy',
                 'SimpleRepoCopyTest_copy1'
         ]:
             Repo({'id': repo_id}).delete(cls.pulp)
 def setUpClass(cls):
     super(ImporterDistributorTest, cls).setUpClass()
     #create repo with inporter/distributer associated
     repo_config = [repo for repo in ROLES.repos if repo.type == 'rpm'][0]
     cls.repo, _, cls.distributor = create_yum_repo(cls.pulp, **repo_config)
     cls.importer = cls.repo.get_importer(cls.pulp, "yum_importer")
     cls.repo1 = Repo(data={'id': cls.__name__ + "_repo1"})
 def test_12_delete_repos(self):
     for repo_id in [
             self.dest_repo1.id, self.dest_repo2.id, self.source_repo.id,
             self.yumrepo.id
     ]:
         response = Repo({'id': repo_id}).delete(self.pulp)
         Task.wait_for_report(self.pulp, response)
Exemple #9
0
 def setUpClass(cls):
     super(IsoRepoTest, cls).setUpClass()
     # FIXME: hardwired role
     cls.repo_role = {
         'id': cls.__name__ + '_repo',
         'feed': DEFAULT_FEED,
         'proxy': ROLES.get('proxy'),
     }
     cls.repo = Repo(data=IsoRepo.from_role(cls.repo_role).as_data())
Exemple #10
0
 def setUpClass(cls):
     super(PuppetRepoTest, cls).setUpClass()
     cls.repo = Repo(data={
         'id': cls.__name__ + "_repo",
         'notes': {
             "_repo-type": "puppet-repo"
         }
     })
     #modules will be fetched from puppet Forge
     cls.feed = 'http://forge.puppetlabs.com'
 def setUpClass(cls):
     super(DockerRepoTest, cls).setUpClass()
     # FIXME: hardwired role
     cls.repo_role = {
         'id': 'docker-test123',
         'feed': DEFAULT_FEED,
         'upstream_name': 'hello-world',
         'proxy': ROLES.get('proxy'),
         'relative_url': '/library/hello-world'
     }
     cls.repo = Repo(data=DockerRepo.from_role(cls.repo_role).as_data())
 def setUpClass(cls):
     super(SimpleOrphanTest, cls).setUpClass()
     # prepare orphans by syncing and deleting a repo
     # make sure the repo is gone
     repo_config = [repo for repo in ROLES.repos if repo.type == 'rpm'][0]
     repo = Repo(repo_config)
     repo.delete(cls.pulp)
     # create and sync repo
     cls.repo, _, _ = create_yum_repo(cls.pulp, **repo_config)
     Task.wait_for_report(cls.pulp, cls.repo.sync(cls.pulp))
     # this is where orphans appear
     Task.wait_for_report(cls.pulp, cls.repo.delete(cls.pulp))
Exemple #13
0
 def setUpClass(cls):
     super(PuppetCopyRepoTest, cls).setUpClass()
     repo_id = cls.__name__
     queries = ['tomcat']
     # create source repo and sync it to have modules fetched
     cls.source_repo, _, _ = create_puppet_repo(cls.pulp, repo_id, queries)
     Task.wait_for_report(cls.pulp, cls.source_repo.sync(cls.pulp))
     # create two destinations repos for copy purpose
     cls.dest_repo1, _, _ = create_puppet_repo(cls.pulp, repo_id + '1', feed=None)
     cls.dest_repo2, _, _ = create_puppet_repo(cls.pulp, repo_id + '2', feed=None)
     # create data for repo
     cls.invalid_repo = Repo(data={'id': cls.__name__ + "_invalidrepo"})
     # create yum repo
     cls.yumrepo, _, _ = create_yum_repo(cls.pulp, repo_id + 'yum', feed=None)
Exemple #14
0
 def setUpClass(cls):
     super(UnitSearchTest, cls).setUpClass()
     #create and sync puppet repo
     repo_id = cls.__name__
     queries = ['jenkins']
     # make sure we run clean
     response = Repo({'id': repo_id}).delete(cls.pulp)
     if response == ResponseLike(202):
         Task.wait_for_report(cls.pulp, response)
     cls.repo1, _, _ = create_puppet_repo(cls.pulp, repo_id, queries)
     Task.wait_for_report(cls.pulp, cls.repo1.sync(cls.pulp))
     # create and sync rpm repo
     repo_config = [repo for repo in ROLES.repos if repo.type == 'rpm'][0]
     cls.repo2, _, _ = create_yum_repo(cls.pulp, **repo_config)
     Task.wait_for_report(cls.pulp, cls.repo2.sync(cls.pulp))
Exemple #15
0
 def setUpClass(cls):
     super(UnitSearchTest, cls).setUpClass()
     #create and sync puppet repo
     # FIXME: hardwired role details
     repo = {
         'id': cls.__name__,
         'queries': ['jenkins'],
         'feed': 'https://forge.puppetlabs.com',
         'proxy': ROLES.get('proxy'),
     }
     # make sure we run clean
     response = Repo({'id': repo['id']}).delete(cls.pulp)
     if response == ResponseLike(202):
         Task.wait_for_report(cls.pulp, response)
     cls.repo1, _, _ = PuppetRepo.from_role(repo).create(cls.pulp)
     Task.wait_for_report(cls.pulp, cls.repo1.sync(cls.pulp))
     # create and sync rpm repo
     repo_config = [repo for repo in ROLES.repos if repo.type == 'rpm'][0]
     cls.repo2, _, _ = YumRepo.from_role(repo_config).create(cls.pulp)
     Task.wait_for_report(cls.pulp, cls.repo2.sync(cls.pulp))
 def test_04_search_repo_in_repos(self):
     #search among puppet-repos by id
     repo = Repo.search(self.pulp,
                        data={
                            "criteria": {
                                "sort": None,
                                "fields": None,
                                "limit": None,
                                "filters": {
                                    "$and": [{
                                        "id":
                                        "SimplePuppetSearchRepoTest"
                                    }, {
                                        "notes._repo-type":
                                        "puppet-repo"
                                    }]
                                },
                                "skip": None
                            }
                        })
     self.assertIn(Repo({"id": self.repo.id}, ['id'], ['id']), repo)
Exemple #17
0
 def setUpClass(cls):
     super(RepoTest, cls).setUpClass()
     cls.repo = Repo(data={'id': cls.__name__ + "_repo"})
     cls.repo2 = Repo(data={'id': cls.__name__ + "_repo2"})
     cls.repo_role = [repo for repo in ROLES.repos if repo.type == 'rpm'][0]
 def setUpClass(cls):
     super(DockerRepoTest, cls).setUpClass()
     cls.repo = Repo(data={'id': cls.__name__ + "_repo"})
     cls.feed = 'https://index.docker.io/'
 def setUpClass(cls):
     super(RepoCudTest, cls).setUpClass()
     # repo with correct data
     cls.repo = Repo(
         data={
             "id":
             cls.__name__ + "_repo",
             "notes": {
                 "_repo-type": "rpm-repo"
             },
             "distributors": [{
                 "distributor_id": "yum_distributor",
                 "auto_publish": False,
                 "distributor_type_id": "yum_distributor",
                 "distributor_config": {
                     "http": False,
                     "relative_url": cls.__name__ + "_repo",
                     "https": True
                 }
             }],
             "importer_type_id":
             "yum_importer",
             "importer_config": {}
         })
     # importer config is missing
     cls.repo1 = Repo(
         data={
             "id":
             cls.__name__ + "_repo1",
             "notes": {
                 "_repo-type": "rpm-repo"
             },
             "distributors": [{
                 "distributor_id": "yum_distributor",
                 "auto_publish": False,
                 "distributor_type_id": "yum_distributor",
                 "distributor_config": {
                     "http": False,
                     "relative_url": cls.__name__ + "_repo1",
                     "https": True
                 }
             }],
             "importer_type_id":
             "yum_importer"
         })
     # repo with no dist/importer data
     cls.repo2 = Repo(data={'id': cls.__name__ + "_repo2"})
     # relative_url is missing
     cls.repo3 = Repo(
         data={
             "id":
             cls.__name__ + "_repo3",
             "notes": {
                 "_repo-type": "rpm-repo"
             },
             "distributors": [{
                 "distributor_id": "yum_distributor",
                 "auto_publish": False,
                 "distributor_type_id": "yum_distributor",
                 "distributor_config": {
                     "http": False,
                     "https": True
                 }
             }],
             "importer_type_id":
             "yum_importer",
             "importer_config": {}
         })
 def setUpClass(cls):
     super(RepoTest, cls).setUpClass()
     cls.repo = Repo(data={'id': cls.__name__ + "_repo"})
     cls.repo2 = Repo(data={'id': cls.__name__ + "_repo2"})
     cls.feed = 'http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/'
 def test_01_race_create(self):
     repo = Repo(data=self.repo_config)
     with self.pulp.async():
         repo.create(self.pulp)
         repo.create(self.pulp)
 def test_02_race_delete(self):
     # see also: https://bugzilla.redhat.com/show_bug.cgi?id=1065455
     repo = Repo(data=self.repo_config)
     with self.pulp.async():
         repo.delete(self.pulp)
         repo.delete(self.pulp)
Exemple #23
0
 def setUpClass(cls):
     super(DockerRepoTest, cls).setUpClass()
     cls.repo = Repo(data={'id': "docker-test123"})
     cls.feed = 'https://index.docker.io/'