Allow using Pungi Koji plugin for ostree phases.
This commits changes `ostree` and `ostree_installer` phases so they can run with Koji Pungi plugin instead of the plain runroot. It is similar to `buildinstall` phase running with Koji plugin. Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
parent
f1eea0b5a6
commit
b8c3ca1abe
8 changed files with 380 additions and 73 deletions
|
|
@ -277,6 +277,78 @@ class OSTreeThreadTest(helpers.PungiTestCase):
|
|||
)
|
||||
self.assertTrue(os.path.isdir(self.repo))
|
||||
|
||||
@mock.patch("pungi.wrappers.scm.get_dir_from_scm")
|
||||
@mock.patch("pungi.wrappers.kojiwrapper.KojiWrapper")
|
||||
def test_run_use_koji_plugin(self, KojiWrapper, get_dir_from_scm):
|
||||
get_dir_from_scm.side_effect = self._dummy_config_repo
|
||||
self.compose.conf["runroot_weights"] = {"ostree": 123}
|
||||
self.compose.conf["ostree_use_koji_plugin"] = True
|
||||
|
||||
koji = KojiWrapper.return_value
|
||||
koji.run_runroot_cmd.side_effect = self._mock_runroot(0)
|
||||
|
||||
t = ostree.OSTreeThread(self.pool, ["http://example.com/repo/1"])
|
||||
|
||||
t.process(
|
||||
(self.compose, self.compose.variants["Everything"], "x86_64", self.cfg), 1
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
get_dir_from_scm.call_args_list,
|
||||
[
|
||||
mock.call(
|
||||
{
|
||||
"scm": "git",
|
||||
"repo": "https://git.fedorahosted.org/git/fedora-atomic.git",
|
||||
"branch": "f24",
|
||||
"dir": ".",
|
||||
},
|
||||
self.topdir + "/work/ostree-1/config_repo",
|
||||
compose=self.compose,
|
||||
)
|
||||
],
|
||||
)
|
||||
self.assertEqual(
|
||||
koji.get_pungi_ostree_cmd.call_args_list,
|
||||
[
|
||||
mock.call(
|
||||
"rrt",
|
||||
"x86_64",
|
||||
{
|
||||
"repo": self.repo,
|
||||
"log-dir": "%s/logs/x86_64/Everything/ostree-1" % self.topdir,
|
||||
"treefile": "%s/fedora-atomic-docker-host.json"
|
||||
% (self.topdir + "/work/ostree-1/config_repo"),
|
||||
"extra-config": "%s/extra_config.json"
|
||||
% (self.topdir + "/work/ostree-1"),
|
||||
"update-summary": False,
|
||||
"ostree-ref": None,
|
||||
"force-new-commit": False,
|
||||
"version": None,
|
||||
},
|
||||
channel=None,
|
||||
mounts=[self.topdir, self.repo],
|
||||
packages=["pungi", "ostree", "rpm-ostree"],
|
||||
weight=123,
|
||||
)
|
||||
],
|
||||
)
|
||||
self.assertEqual(
|
||||
koji.run_runroot_cmd.call_args_list,
|
||||
[
|
||||
mock.call(
|
||||
koji.get_pungi_ostree_cmd.return_value,
|
||||
log_file=self.topdir
|
||||
+ "/logs/x86_64/Everything/ostree-1/runroot.log",
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
self.assertTrue(
|
||||
os.path.isfile(os.path.join(self.topdir, "work/ostree-1/extra_config.json"))
|
||||
)
|
||||
self.assertTrue(os.path.isdir(self.repo))
|
||||
|
||||
@mock.patch("pungi.wrappers.scm.get_dir_from_scm")
|
||||
@mock.patch("pungi.wrappers.kojiwrapper.KojiWrapper")
|
||||
def test_run_fail(self, KojiWrapper, get_dir_from_scm):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue