示例#1
0
    def _load_ubiconfig(self, filenames, ubiconfig_dir_or_url, content_sets=None, repo_ids=None):
        loader = ubiconfig.get_loader(ubiconfig_dir_or_url)
        ubi_conf_list = []

        if filenames:
            ubi_conf_list.extend(loader.load(filename) for filename in filenames)
        else:
            ubi_conf_list.extend(loader.load_all())

        return self._filter_ubi_conf_list(ubi_conf_list, content_sets, repo_ids)
示例#2
0
    def _load_ubiconfig(self, filenames, ubiconfig_dir_or_url):
        loader = ubiconfig.get_loader(ubiconfig_dir_or_url)
        ubi_conf_list = []
        if filenames:
            ubi_conf_list.extend(
                loader.load(filename) for filename in filenames)
        else:
            ubi_conf_list.extend(loader.load_all())

        return ubi_conf_list
示例#3
0
def test_match_modules_without_profile(ubi_repo_set, executor):
    test_ubiconf = ubiconfig.get_loader(TEST_DATA_DIR).load(
        'ubiconf_golang.yaml')
    mocked_ubipop_runner = UbiPopulateRunner(
        MagicMock(),
        ubi_repo_set,
        test_ubiconf,
        False,
        executor,
    )

    mocked_ubipop_runner.pulp.search_modules.return_value = [
        get_test_mod(
            name="go-toolset",
            profiles={"common": ["go-toolset"]},
            packages=[
                "go-toolset-0:1.11.5-1.module+el8+2774+11afa8b5.x86_64",
                "golang-0:1.11.5-1.module+el8+2774+11afa8b5.x86_64",
                "golang-bin-0:1.11.5-1.module+el8+2774+11afa8b5.x86_64",
                "golang-docs-0:1.11.5-1.module+el8+2774+11afa8b5.noarch",
                "golang-misc-0:1.11.5-1.module+el8+2774+11afa8b5.noarch",
                "golang-race-0:1.11.5-1.module+el8+2774+11afa8b5.x86_64",
                "golang-src-0:1.11.5-1.module+el8+2774+11afa8b5.noarch",
                "golang-tests-0:1.11.5-1.module+el8+2774+11afa8b5.noarch",
            ],
        ),
    ]

    packages_fnames = [
        "go-toolset-1.11.5-1.module+el8+2774+11afa8b5.x86_64.rpm",
        "golang-1.11.5-1.module+el8+2774+11afa8b5.x86_64.rpm",
        "golang-bin-1.11.5-1.module+el8+2774+11afa8b5.x86_64.rpm",
        "golang-docs-1.11.5-1.module+el8+2774+11afa8b5.noarch.rpm",
        "golang-misc-1.11.5-1.module+el8+2774+11afa8b5.noarch.rpm",
        "golang-race-1.11.5-1.module+el8+2774+11afa8b5.x86_64.rpm",
        "golang-src-1.11.5-1.module+el8+2774+11afa8b5.noarch.rpm",
        "golang-tests-1.11.5-1.module+el8+2774+11afa8b5.noarch.rpm",
    ]

    mocked_ubipop_runner.pulp.search_rpms.side_effect = _get_search_rpms_side_effect(
        packages_fnames, )  # pylint: disable=protected-access

    mocked_ubipop_runner._match_modules()  # pylint: disable=protected-access

    assert len(mocked_ubipop_runner.repos.modules) == 1
    assert len(mocked_ubipop_runner.repos.modules['go-toolsetrhel8']) == 1
    assert mocked_ubipop_runner.repos.modules['go-toolsetrhel8'][
        0].name == 'go-toolset'
    assert len(
        mocked_ubipop_runner.repos.pkgs_from_modules['go-toolsetrhel8']) == 8
    assert len(mocked_ubipop_runner.repos.packages) == 8
    assert len(mocked_ubipop_runner.repos.debug_rpms) == 0
    def _load_ubiconfig(self):
        ubiconfig_dir_or_url = self._ubiconfig_dir_or_url
        filenames = self._ubiconfig_filename_list
        loader = ubiconfig.get_loader(ubiconfig_dir_or_url)
        ubi_conf_list = []

        if filenames:
            ubi_conf_list.extend(
                loader.load(filename) for filename in filenames)
        else:
            ubi_conf_list.extend(loader.load_all())

        return self._filter_ubi_conf_list(ubi_conf_list)
def test_ubiconfig():
    yield ubiconfig.get_loader(TEST_DATA_DIR).load("conf.yaml")
def load_ubiconfig(filename):
    loader = ubiconfig.get_loader(TEST_DATA_DIR)
    return loader.load(filename)
示例#7
0
def fixture_test_ubiconfig():
    yield ubiconfig.get_loader(TEST_DATA_DIR).load("ubi7/conf.yaml")