Exemplo n.º 1
0
    def test_032_gen_mock_cfg_content(self):
        ctx = mk_ctx()
        ctx["label"] = "fedora-custom-19-x86_64"
        ref = C.readfile("result.mock.cfg.1", _CURDIR)

        s = TT.gen_mock_cfg_content(ctx, C.template_paths())
        self.assertEquals(s, ref, C.diff(s, ref))
Exemplo n.º 2
0
    def test_020_gen_repo_file_content(self):
        ctx = mk_ctx()
        ctx.update(ctx["repos"][0].as_dict())

        ref = C.readfile("result.repo.0", _CURDIR)
        s = TT.gen_repo_file_content(ctx, C.template_paths())

        self.assertEquals(s, ref, C.diff(s, ref))
Exemplo n.º 3
0
    def test_040_gen_rpmspec_content(self):
        repo = mk_remote_repo()
        ctx = mk_ctx([repo])

        ref = C.readfile("result.yum-repodata.spec.0", _CURDIR).strip()
        ref = ref.replace("DATESTAMP", TT._datestamp())

        s = TT.gen_rpmspec_content(repo, ctx, C.template_paths()).strip()
        self.assertEquals(s, ref, C.diff(s, ref))
Exemplo n.º 4
0
    def test_022_gen_repo_file_content__w_keyid_and_repo_params(self):
        ctx = mk_ctx()
        ctx.update(ctx["repos"][0].as_dict())

        # Override it:
        ctx["keyid"] = "dummykey001"
        ctx["repo_params"] = ["failovermethod=priority", "metadata_expire=7d"]

        ref = C.readfile("result.repo.1", _CURDIR)
        s = TT.gen_repo_file_content(ctx, C.template_paths())

        self.assertEquals(s, ref, C.diff(s, ref))
Exemplo n.º 5
0
    def test_42_gen_rpmspec_content__w_keyid(self):
        repo = mk_remote_repo()
        ctx = mk_ctx([repo])

        keyids = _find_gpg_keyids()
        if keyids:
            ctx["keyid"] = keyid = random.choice(keyids)
        else:
            sys.stderr.write("No GPG keyid was found. Skip this test...\n")
            return

        ref = C.readfile("result.yum-repodata.spec.1", _CURDIR).strip()
        ref = ref.replace("DATESTAMP", TT._datestamp())

        s = TT.gen_rpmspec_content(repo, ctx, C.template_paths()).strip()
        self.assertEquals(s, ref, C.diff(s, ref))
Exemplo n.º 6
0
    def test_030_gen_mock_cfg_content(self):
        ctx = mk_ctx()
        ref = C.readfile("result.mock.cfg.0", _CURDIR)

        s = TT.gen_mock_cfg_content(ctx, C.template_paths())
        self.assertEquals(s, ref, C.diff(s, ref))