Exemple #1
0
    def setUpClass(cls):
        """Provide a server config and a repository ID."""
        cls.cfg = config.get_config()

        if cls.cfg.pulp_version < version.Version('2.8'):
            raise unittest.SkipTest('These tests require Pulp 2.8 or above.')

        pulp_admin_login(cls.cfg)

        cls.repo_id = utils.uuid4()
        docker_utils.repo_create(
            cls.cfg,
            enable_v2='true',
            repo_id=cls.repo_id,
        )
        docker_utils.repo_sync(cls.cfg, repo_id=cls.repo_id)
        cls.delete_cmd = docker_utils.repo_delete(cls.cfg, cls.repo_id)
Exemple #2
0
    def test_basic(self):
        """Create a docker repository. Only provide a repository ID.

        Assert the return code is 0.
        """
        completed_proc = docker_utils.repo_create(self.cfg,
                                                  repo_id=self.repo_id)
        self.assertEqual(completed_proc.returncode, 0)
Exemple #3
0
    def setUpClass(cls):
        """Provide a server config and a repository ID."""
        cls.cfg = config.get_config()
        if cls.cfg.pulp_version < version.Version('2.8'):
            raise unittest.SkipTest('These tests require Pulp 2.8 or above.')
        if not selectors.bug_is_fixed(1710, cls.cfg.pulp_version):
            raise unittest.SkipTest('https://pulp.plan.io/issues/1710')

        pulp_admin_login(cls.cfg)

        # Create a repository and update its distributor.
        cls.repo_id = utils.uuid4()
        cls.repo_registry_id = 'test/' + utils.uuid4()
        docker_utils.repo_create(cls.cfg, repo_id=cls.repo_id)
        cls.update_response = docker_utils.repo_update(
            cls.cfg,
            repo_id=cls.repo_id,
            repo_registry_id=cls.repo_registry_id,
        )
Exemple #4
0
    def test_with_feed_upstream_name(self):
        """Create a docker repository. Provide a feed and upstream name.

        Assert the return code is 0.
        """
        completed_proc = docker_utils.repo_create(
            self.cfg,
            feed=_FEED,
            repo_id=self.repo_id,
            upstream_name=_UPSTREAM_NAME,
        )
        self.assertEqual(completed_proc.returncode, 0)
Exemple #5
0
 def test_all(self):
     """Create a docker repo with an invalid feed and sync it."""
     repo_id = utils.uuid4()
     self.assertNotIn(
         'Task Failed',
         repo_create(
             self.cfg,
             feed='https://docker.example.com',
             repo_id=repo_id,
             upstream_name=get_upstream_name(self.cfg),
         ).stdout)
     self.addCleanup(repo_delete, self.cfg, repo_id)
     client = cli.Client(self.cfg, cli.echo_handler)
     proc = client.run(('pulp-admin', 'docker', 'repo', 'sync', 'run',
                        '--repo-id', repo_id))
     if selectors.bug_is_fixed(427, self.cfg.pulp_version):
         with self.subTest():
             self.assertNotEqual(proc.returncode, 0)
     with self.subTest():
         self.assertNotIn('Task Succeeded', proc.stdout)
     with self.subTest():
         self.assertIn('Task Failed', proc.stdout)