def setUpClass(cls): super(NodeTest, cls).setUpClass() node_role = ROLES.nodes[0] # configure the node via cli cli = Cli.ready_instance(**node_role) cls.node = Node.get(cls.pulp, node_role.id) cls.node.cli = cli # instantiate a pulp child from the role details cls.pulp_child = Pulp(node_role.url, tuple(node_role.auth), node_role.verify_api_ssl)
def setUpClass(cls): super(RegRepoFeedTest, cls).setUpClass() # create repo cls.repo, cls.importer, cls.distributor = create_yum_repo(cls.pulp, cls.__name__ + "_repo", feed='http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/') # create consumer cls.consumer = Consumer(ROLES.consumers[0]) setattr(cls.consumer, 'cli', Cli.ready_instance(**ROLES.consumers[0]))
def setUpClass(cls): super(CliConsumerTest, cls).setUpClass() consumer_config = ROLES.consumers[0] # create all repos with cls.pulp.asserting(True): cls.repos = [create_yum_repo(cls.pulp, **repo) for repo in consumer_config.repos if repo.type == 'rpm'] for repo, _, distributor in cls.repos: Task.wait_for_response(cls.pulp, repo.sync(cls.pulp)) Task.wait_for_response(cls.pulp, repo.publish(cls.pulp, data={'id': distributor.id})) cls.consumer_cli = Cli.ready_instance(**consumer_config) cls.consumer = Consumer(consumer_config)
def setUpClass(cls): super(RegRepoFeedTest, cls).setUpClass() repo_role = [repo for repo in ROLES.repos if repo.type == 'rpm'][0].copy() repo_role.id = cls.__name__ + '_repo' # create repo cls.repo, cls.importer, [cls.distributor] = YumRepoFacade.from_role(repo_role).create(cls.pulp) # create consumer cls.consumer = Consumer(ROLES.consumers[0]) setattr(cls.consumer, 'cli', Cli.ready_instance(**ROLES.consumers[0]))
def setUpClass(cls): super(RegRepoCopyTest, cls).setUpClass() # create repo repo_role = [repo for repo in ROLES.repos if repo.type == 'rpm'][0].copy() repo_role.id = cls.__name__ + '_repo1' cls.repo1, cls.importer1, [cls.distributor1] = YumRepoFacade.from_role(repo_role).create(cls.pulp) cls.repo2, cls.importer2, [cls.distributor2] = YumRepoFacade(id=cls.__name__ + '_repo2', importer=YumImporter(feed=None), distributors=[YumDistributor(relative_url='xyz')]).create(cls.pulp) # create consumer cls.consumer = Consumer(ROLES.consumers[0]) setattr(cls.consumer, 'cli', Cli.ready_instance(**ROLES.consumers[0]))
def setUpClass(cls): super(CliConsumerTest, cls).setUpClass() # create all repos # get repo configs across all consumers repo_configs = sum([consumer.repos for consumer in ROLES.consumers], []) # filter&uniq repo configs repo_configs = { repo.id: repo for repo in repo_configs if repo.type == 'rpm' }.values() with cls.pulp.asserting(True): cls.repos = [ create_yum_repo(cls.pulp, **repo_config) for repo_config in repo_configs ] # sync&publish all repos with cls.pulp.asserting(True): task_reports = [repo.sync(cls.pulp) for repo, _, _ in cls.repos] Task.wait_for_reports(cls.pulp, task_reports) with cls.pulp.asserting(True): task_reports = [ repo.publish(cls.pulp, distributor.id) for repo, _, distributor in cls.repos ] Task.wait_for_reports(cls.pulp, task_reports) # create all consumers # gather all consumers consumer_configs = { consumer.id: consumer for consumer in ROLES.consumers } with cls.pulp.asserting(True): cls.consumers = [ Consumer(consumer_config) for consumer_config in consumer_configs.values() ] # set up consumer cli & link repos for consumer in cls.consumers: setattr(consumer, 'cli', Cli.ready_instance(**consumer_configs[consumer.id])) setattr( consumer, 'repos', filter( lambda (repo, importer, distributor): any(repo.id == repo_config.id for repo_config in consumer_configs[consumer.id].repos), cls.repos))
def setUpClass(cls): super(RegRepoFeedTest, cls).setUpClass() repo_role = [repo for repo in ROLES.repos if repo.type == 'rpm'][0].copy() repo_role.id = cls.__name__ + '_repo' # create repo cls.repo, cls.importer, [ cls.distributor ] = YumRepoFacade.from_role(repo_role).create(cls.pulp) # create consumer cls.consumer = Consumer(ROLES.consumers[0]) setattr(cls.consumer, 'cli', Cli.ready_instance(**ROLES.consumers[0]))
def setUpClass(cls): super(RegRepoNoFeedTest, cls).setUpClass() # create repo cls.repo, cls.importer, [cls.distributor] = YumRepoFacade( id=cls.__name__ + "_repo", importer=YumImporter(feed=None), distributors=[YumDistributor(relative_url='foo')]).create(cls.pulp) # create consumer cls.consumer = Consumer(ROLES.consumers[0]) setattr(cls.consumer, 'cli', Cli.ready_instance(**ROLES.consumers[0])) # rpm cls.rpm_url_pike = 'https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/pike-2.2-1.noarch.rpm'
def setUpClass(cls): super(RegRepoNoFeedTest, cls).setUpClass() # create repo cls.repo, cls.importer, [cls.distributor] = YumRepoFacade( id=cls.__name__ + "_repo", importer=YumImporter(feed=None), distributors=[YumDistributor(relative_url="foo")], ).create(cls.pulp) # create consumer cls.consumer = Consumer(ROLES.consumers[0]) setattr(cls.consumer, "cli", Cli.ready_instance(**ROLES.consumers[0])) # rpm cls.rpm_url_pike = "https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/pike-2.2-1.noarch.rpm"
def setUpClass(cls): super(RegRepoCopyTest, cls).setUpClass() # create repo repo_role = [repo for repo in ROLES.repos if repo.type == 'rpm'][0].copy() repo_role.id = cls.__name__ + '_repo1' cls.repo1, cls.importer1, [ cls.distributor1 ] = YumRepoFacade.from_role(repo_role).create(cls.pulp) cls.repo2, cls.importer2, [cls.distributor2] = YumRepoFacade( id=cls.__name__ + '_repo2', importer=YumImporter(feed=None), distributors=[YumDistributor(relative_url='xyz')]).create(cls.pulp) # create consumer cls.consumer = Consumer(ROLES.consumers[0]) setattr(cls.consumer, 'cli', Cli.ready_instance(**ROLES.consumers[0]))
def setUpClass(cls): super(CliConsumerTest, cls).setUpClass() # create all repos # get repo configs across all consumers repo_configs = sum([consumer.repos for consumer in ROLES.consumers], []) # filter&uniq repo configs repo_configs = {repo.id: repo for repo in repo_configs if repo.type == 'rpm'}.values() with cls.pulp.asserting(True): cls.repos = [ create_yum_repo(cls.pulp, **repo_config) for repo_config in repo_configs ] # sync&publish all repos with cls.pulp.asserting(True): task_reports = [repo.sync(cls.pulp) for repo, _, _ in cls.repos] Task.wait_for_reports(cls.pulp, task_reports) with cls.pulp.asserting(True): task_reports = [ repo.publish(cls.pulp, distributor.id) for repo, _, distributor in cls.repos] Task.wait_for_reports(cls.pulp, task_reports) # create all consumers # gather all consumers consumer_configs = {consumer.id: consumer for consumer in ROLES.consumers} with cls.pulp.asserting(True): cls.consumers = [Consumer(consumer_config) for consumer_config in consumer_configs.values()] # set up consumer cli & link repos for consumer in cls.consumers: setattr(consumer, 'cli', Cli.ready_instance(**consumer_configs[consumer.id])) setattr( consumer, 'repos', filter( lambda (repo, importer, distributor): any(repo.id == repo_config.id for repo_config in consumer_configs[consumer.id].repos), cls.repos ) )