| |
@@ -51,6 +51,7 @@
|
| |
'release_name': 'Fedora',
|
| |
'release_version': 'Rawhide',
|
| |
'koji_profile': 'koji',
|
| |
+ 'runroot': True,
|
| |
'runroot_tag': 'rrt',
|
| |
'image_volid_formats': ['{release_short}-{variant}-{arch}'],
|
| |
})
|
| |
@@ -114,8 +115,8 @@
|
| |
@mock.patch('pungi.phases.ostree_installer.iso')
|
| |
@mock.patch('os.link')
|
| |
@mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper')
|
| |
- def test_run(self, KojiWrapper, link, iso,
|
| |
- get_file_size, get_mtime, ImageCls, run):
|
| |
+ def test_run_in_runroot(self, KojiWrapper, link, iso,
|
| |
+ get_file_size, get_mtime, ImageCls, run):
|
| |
self.compose.supported = False
|
| |
pool = mock.Mock()
|
| |
cfg = {
|
| |
@@ -150,8 +151,8 @@
|
| |
@mock.patch('pungi.phases.ostree_installer.iso')
|
| |
@mock.patch('os.link')
|
| |
@mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper')
|
| |
- def test_run_external_source(self, KojiWrapper, link, iso,
|
| |
- get_file_size, get_mtime, ImageCls, run):
|
| |
+ def test_run_in_runroot_with_external_source(self, KojiWrapper, link, iso,
|
| |
+ get_file_size, get_mtime, ImageCls, run):
|
| |
pool = mock.Mock()
|
| |
cfg = {
|
| |
'source_repo_from': 'http://example.com/repo/$arch/',
|
| |
@@ -183,9 +184,9 @@
|
| |
@mock.patch('pungi.wrappers.iso')
|
| |
@mock.patch('os.link')
|
| |
@mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper')
|
| |
- def test_fail_with_relative_template_path_but_no_repo(self, KojiWrapper, link,
|
| |
- iso, get_file_size,
|
| |
- get_mtime, ImageCls, run):
|
| |
+ def test_fail_in_runroot_with_relative_template_path_but_no_repo(self, KojiWrapper, link,
|
| |
+ iso, get_file_size,
|
| |
+ get_mtime, ImageCls, run):
|
| |
pool = mock.Mock()
|
| |
cfg = {
|
| |
'source_repo_from': 'Everything',
|
| |
@@ -216,9 +217,9 @@
|
| |
@mock.patch('pungi.phases.ostree_installer.iso')
|
| |
@mock.patch('os.link')
|
| |
@mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper')
|
| |
- def test_run_clone_templates(self, KojiWrapper, link, iso,
|
| |
- get_file_size, get_mtime, ImageCls, run,
|
| |
- get_dir_from_scm):
|
| |
+ def test_run_in_runroot_clone_templates(self, KojiWrapper, link, iso,
|
| |
+ get_file_size, get_mtime, ImageCls, run,
|
| |
+ get_dir_from_scm):
|
| |
pool = mock.Mock()
|
| |
cfg = {
|
| |
'source_repo_from': 'Everything',
|
| |
@@ -264,8 +265,8 @@
|
| |
@mock.patch('pungi.phases.ostree_installer.iso')
|
| |
@mock.patch('os.link')
|
| |
@mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper')
|
| |
- def test_run_with_implicit_release(self, KojiWrapper, link, iso,
|
| |
- get_file_size, get_mtime, ImageCls, run):
|
| |
+ def test_run_in_runroot_with_implicit_release(self, KojiWrapper, link, iso,
|
| |
+ get_file_size, get_mtime, ImageCls, run):
|
| |
pool = mock.Mock()
|
| |
cfg = {
|
| |
'source_repo_from': 'Everything',
|
| |
@@ -322,8 +323,8 @@
|
| |
@mock.patch('pungi.phases.ostree_installer.iso')
|
| |
@mock.patch('os.link')
|
| |
@mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper')
|
| |
- def test_fail_crash(self, KojiWrapper, link, iso, get_file_size,
|
| |
- get_mtime, ImageCls, run):
|
| |
+ def test_fail_in_runroot_crash(self, KojiWrapper, link, iso, get_file_size,
|
| |
+ get_mtime, ImageCls, run):
|
| |
pool = mock.Mock()
|
| |
cfg = {
|
| |
'source_repo_from': 'Everything',
|
| |
@@ -372,6 +373,63 @@
|
| |
% self.topdir)
|
| |
])
|
| |
|
| |
+ @mock.patch('rpmUtils.arch.getBaseArch')
|
| |
+ @mock.patch('kobo.shortcuts.run')
|
| |
+ @mock.patch('productmd.images.Image')
|
| |
+ @mock.patch('pungi.util.get_mtime')
|
| |
+ @mock.patch('pungi.util.get_file_size')
|
| |
+ @mock.patch('pungi.phases.ostree_installer.iso')
|
| |
+ @mock.patch('os.link')
|
| |
+ def test_run_locally(self, link, iso, get_file_size,
|
| |
+ get_mtime, ImageCls, run, get_base_arch):
|
| |
+ get_base_arch.return_value = 'x86_64'
|
| |
+ # runroot not enabled in config
|
| |
+ compose = helpers.DummyCompose(self.topdir, {
|
| |
+ 'release_name': 'Fedora',
|
| |
+ 'release_version': 'Rawhide',
|
| |
+ 'koji_profile': 'koji',
|
| |
+ })
|
| |
+ pool = mock.Mock()
|
| |
+ cfg = {
|
| |
+ 'source_repo_from': 'Everything',
|
| |
+ 'release': '20160321.n.0',
|
| |
+ }
|
| |
+
|
| |
+ t = ostree.OstreeInstallerThread(pool)
|
| |
+
|
| |
+ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1)
|
| |
+ self.assertEqual(run.call_args_list,
|
| |
+ [mock.call(['lorax', '--product=Fedora', '--version=Rawhide', '--release=20160321.n.0',
|
| |
+ '--source=file://{0}/compose/Everything/x86_64/os'.format(self.topdir),
|
| |
+ '--variant=Everything', '--nomacboot',
|
| |
+ '--isfinal', '--volid=test-Rawhide Everything.x86_64',
|
| |
+ '{0}/work/x86_64/Everything/ostree_installer'.format(self.topdir)]),
|
| |
+ mock.call('cp -av {0}/work/x86_64/Everything/ostree_installer/* {0}/compose/Everything/x86_64/os/'.format(self.topdir))])
|
| |
+
|
| |
+ @mock.patch('rpmUtils.arch.getBaseArch')
|
| |
+ @mock.patch('kobo.shortcuts.run')
|
| |
+ def test_run_locally_skip_not_match_arch(self, run, get_base_arch):
|
| |
+ get_base_arch.return_value = 'x86_64'
|
| |
+ # runroot not enabled in config
|
| |
+ compose = helpers.DummyCompose(self.topdir, {
|
| |
+ 'release_name': 'Fedora',
|
| |
+ 'release_version': 'Rawhide',
|
| |
+ 'koji_profile': 'koji',
|
| |
+ })
|
| |
+ pool = mock.Mock()
|
| |
+ cfg = {
|
| |
+ 'source_repo_from': 'Everything',
|
| |
+ 'release': '20160321.n.0',
|
| |
+ }
|
| |
+
|
| |
+ t = ostree.OstreeInstallerThread(pool)
|
| |
+
|
| |
+ variant = compose.variants['Everything']
|
| |
+ t.process((compose, variant, 'ppc64', cfg), 1)
|
| |
+ pool.log_warning.assert_has_calls([
|
| |
+ mock.call('[SKIP ] OSTree installer for arch ppc64, variant %s. Host arch is x86_64.' % variant)
|
| |
+ ])
|
| |
+ self.assertFalse(run.called)
|
| |
|
| |
if __name__ == '__main__':
|
| |
unittest.main()
|
| |