Exemplo n.º 1
0
    def setUpClass(cls):
        """
        Create all the client instances needed to communicate with Pulp.
        """
        configuration = Configuration(**BINDINGS_CONFIGURATION)

        rpm_client = RpmApiClient(configuration)
        migration_client = MigrationApiClient(configuration)

        # Create api clients for all resource types
        cls.rpm_repo_api = RepositoriesRpmApi(rpm_client)
        cls.rpm_repo_versions_api = RepositoriesRpmVersionsApi(rpm_client)
        cls.rpm_remote_api = RemotesRpmApi(rpm_client)
        cls.rpm_distribution_api = DistributionsRpmApi(rpm_client)
        cls.rpm_publication_api = PublicationsRpmApi(rpm_client)
        cls.rpm_content_apis = {
            "advisory": ContentAdvisoriesApi(rpm_client),
            "disttree": ContentDistributionTreesApi(rpm_client),
            "modulemd": ContentModulemdsApi(rpm_client),
            "modulemd-defaults": ContentModulemdDefaultsApi(rpm_client),
            "category": ContentPackagecategoriesApi(rpm_client),
            "environment": ContentPackageenvironmentsApi(rpm_client),
            "group": ContentPackagegroupsApi(rpm_client),
            "langpack": ContentPackagelangpacksApi(rpm_client),
            "package": ContentPackagesApi(rpm_client),
        }
        cls.migration_plans_api = MigrationPlansApi(migration_client)
        cls.pulp2content_api = Pulp2ContentApi(migration_client)
        cls.pulp2repositories_api = Pulp2RepositoriesApi(migration_client)
Exemplo n.º 2
0
    def setUpClass(cls):
        """Create class-wide variables."""
        cls.client = gen_rpm_client()
        cls.repo_api = RepositoriesRpmApi(cls.client)
        cls.remote_api = RemotesRpmApi(cls.client)
        cls.advisory_api = ContentAdvisoriesApi(cls.client)
        delete_orphans()

        def _sync(url=None):
            repo = cls.repo_api.create(gen_repo())
            remote = cls.remote_api.create(gen_rpm_remote(url))
            repository_sync_data = RpmRepositorySyncURL(remote=remote.pulp_href)
            sync_response = cls.repo_api.sync(repo.pulp_href, repository_sync_data)
            monitor_task(sync_response.task)
            return cls.repo_api.read(repo.pulp_href)

        # sync repos to get two conflicting advisories to use later in tests
        cls.repo_rpm_unsigned = _sync(url=RPM_UNSIGNED_FIXTURE_URL)
        cls.repo_rpm_advisory_diffpkgs = _sync(url=RPM_ADVISORY_DIFFERENT_PKGLIST_URL)
        cls.advisory_rpm_unsigned_href = (
            cls.advisory_api.list(
                repository_version=cls.repo_rpm_unsigned.latest_version_href,
                id=RPM_ADVISORY_TEST_ID,
            )
            .results[0]
            .pulp_href
        )
        cls.advisory_rpm_advisory_diffpkgs_href = (
            cls.advisory_api.list(
                repository_version=cls.repo_rpm_advisory_diffpkgs.latest_version_href,
                id=RPM_ADVISORY_TEST_ID,
            )
            .results[0]
            .pulp_href
        )
Exemplo n.º 3
0
    def setUpClass(cls):
        """
        Create all the client instances needed to communicate with Pulp.
        """
        configuration = Configuration(**BINDINGS_CONFIGURATION)

        rpm_client = RpmApiClient(configuration)
        migration_client = MigrationApiClient(configuration)

        # Create api clients for all resource types
        cls.rpm_repo_api = RepositoriesRpmApi(rpm_client)
        cls.rpm_repo_versions_api = RepositoriesRpmVersionsApi(rpm_client)
        cls.rpm_remote_api = RemotesRpmApi(rpm_client)
        cls.rpm_distribution_api = DistributionsRpmApi(rpm_client)
        cls.rpm_publication_api = PublicationsRpmApi(rpm_client)
        cls.rpm_content_apis = {
            'advisory': ContentAdvisoriesApi(rpm_client),
            # skip until https://pulp.plan.io/issues/8050 is fixed
            # 'disttree': ContentDistributionTreesApi(rpm_client),
            'modulemd': ContentModulemdsApi(rpm_client),
            'modulemd-defaults': ContentModulemdDefaultsApi(rpm_client),
            'category': ContentPackagecategoriesApi(rpm_client),
            'environment': ContentPackageenvironmentsApi(rpm_client),
            'group': ContentPackagegroupsApi(rpm_client),
            'langpack': ContentPackagelangpacksApi(rpm_client),
            'package': ContentPackagesApi(rpm_client),
        }
        cls.migration_plans_api = MigrationPlansApi(migration_client)
Exemplo n.º 4
0
 def setUpClass(cls):
     """Create class-wide variable."""
     cls.cfg = config.get_config()
     cls.client = api.Client(cls.cfg)
     delete_orphans()
     cls.rpm_client = gen_rpm_client()
     cls.tasks_api = TasksApi(core_client)
     cls.content_api = ContentAdvisoriesApi(cls.rpm_client)
     cls.bad_file_to_use = os.path.join(RPM_UNSIGNED_FIXTURE_URL, RPM_PACKAGE_FILENAME)
Exemplo n.º 5
0
    def setUpClass(cls):
        """Create class-wide variables."""
        cls.cfg = config.get_config()
        cls.client = gen_rpm_client()
        cls.repo_api = RepositoriesRpmApi(cls.client)
        cls.remote_api = RemotesRpmApi(cls.client)
        cls.rpm_package_content_api = ContentPackagesApi(cls.client)
        cls.rpm_advisory_content_api = ContentAdvisoriesApi(cls.client)

        cls.test_advisory = "RHEA-2012:0055"
        cls.test_advisory_dependencies = ["walrus", "penguin", "shark"]
        delete_orphans(cls.cfg)
Exemplo n.º 6
0
 def setUpClass(cls):
     """Create class-wide variables."""
     cls.cfg = config.get_config()
     cls.client = gen_rpm_client()
     cls.repo_api = RepositoriesRpmApi(cls.client)
     cls.remote_api = RemotesRpmApi(cls.client)
     cls.rpm_advisory_content_api = ContentAdvisoriesApi(cls.client)
     cls.rpm_modulemd_content_api = ContentModulemdsApi(cls.client)
     cls.rpm_package_content_api = ContentPackagesApi(cls.client)
     cls.test_advisory = "FEDORA-2019-0329090518"
     # these dependencies have same name for dependent packages as dependant modules
     cls.test_advisory_dependencies = ["postgresql", "nodejs"]
     delete_orphans()
    def setUpClass(cls):
        """
        Create all the client instances needed to communicate with Pulp.
        """
        configuration = Configuration(**BINDINGS_CONFIGURATION)

        file_client = FileApiClient(configuration)
        rpm_client = RpmApiClient(configuration)
        migration_client = MigrationApiClient(configuration)

        # Create api clients for File
        cls.file_repo_api = RepositoriesFileApi(file_client)
        cls.file_repo_versions_api = RepositoriesFileVersionsApi(file_client)
        cls.file_remote_api = RemotesFileApi(file_client)
        cls.file_distribution_api = DistributionsFileApi(file_client)
        cls.file_publication_api = PublicationsFileApi(file_client)
        cls.file_content_api = ContentFilesApi(file_client)

        # Create api clients for RPM
        cls.rpm_repo_api = RepositoriesRpmApi(rpm_client)
        cls.rpm_repo_versions_api = RepositoriesRpmVersionsApi(rpm_client)
        cls.rpm_remote_api = RemotesRpmApi(rpm_client)
        cls.rpm_distribution_api = DistributionsRpmApi(rpm_client)
        cls.rpm_publication_api = PublicationsRpmApi(rpm_client)
        cls.rpm_content_apis = {
            'advisory': ContentAdvisoriesApi(rpm_client),
            'disttree': ContentDistributionTreesApi(rpm_client),
            'modulemd': ContentModulemdsApi(rpm_client),
            'modulemd-defaults': ContentModulemdDefaultsApi(rpm_client),
            'category': ContentPackagecategoriesApi(rpm_client),
            'environment': ContentPackageenvironmentsApi(rpm_client),
            'group': ContentPackagegroupsApi(rpm_client),
            'langpack': ContentPackagelangpacksApi(rpm_client),
            'package': ContentPackagesApi(rpm_client),
        }

        # Create api clients for Migration
        cls.migration_plans_api = MigrationPlansApi(migration_client)
        cls.pulp2content_api = Pulp2ContentApi(migration_client)
        cls.pulp2repositories_api = Pulp2RepositoriesApi(migration_client)
Exemplo n.º 8
0
def rpm_advisory_api(rpm_client):
    """Fixture for RPM distribution API."""
    return ContentAdvisoriesApi(rpm_client)