image-build: Use install_tree from parent for nested variants
Buildinstall only runs for top-level variants. Addons, optionals and integrated layered products must reuse install tree from their parent, because otherwise there would be no boot.iso. Fixes: #472 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
c338219ef0
commit
721932a573
4 changed files with 67 additions and 6 deletions
|
|
@ -89,8 +89,8 @@ class DummyCompose(object):
|
|||
|
||||
def setup_optional(self):
|
||||
self.all_variants['Server-optional'] = MockVariant(
|
||||
uid='Server-optional', arches=['x86_64'], type='optional', is_empty=False,
|
||||
parent=self.variants['Server'])
|
||||
uid='Server-optional', arches=['x86_64'], type='optional', is_empty=False)
|
||||
self.all_variants['Server-optional'].parent = self.variants['Server']
|
||||
self.variants['Server'].variants = {'optional': self.all_variants['Server-optional']}
|
||||
|
||||
def get_variants(self, arch=None, types=None):
|
||||
|
|
|
|||
|
|
@ -564,6 +564,66 @@ class TestImageBuildPhase(PungiTestCase):
|
|||
self.assertEqual(args[0][1]['image_conf'].get('image-build', {}).get('ksurl'),
|
||||
resolve_git_url.return_value)
|
||||
|
||||
@mock.patch('pungi.phases.image_build.ThreadPool')
|
||||
def test_image_build_optional(self, ThreadPool):
|
||||
compose = DummyCompose(self.topdir, {
|
||||
'image_build': {
|
||||
'^Server-optional$': [
|
||||
{
|
||||
'image-build': {
|
||||
'format': [('docker', 'tar.xz')],
|
||||
'name': 'Fedora-Docker-Base',
|
||||
'target': 'f24',
|
||||
'version': 'Rawhide',
|
||||
'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git',
|
||||
'kickstart': "fedora-docker-base.ks",
|
||||
'distro': 'Fedora-20',
|
||||
'disk_size': 3,
|
||||
'failable': ['x86_64'],
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
'koji_profile': 'koji',
|
||||
})
|
||||
compose.setup_optional()
|
||||
|
||||
self.assertValidConfig(compose.conf)
|
||||
|
||||
phase = ImageBuildPhase(compose)
|
||||
|
||||
phase.run()
|
||||
|
||||
# assert at least one thread was started
|
||||
self.assertTrue(phase.pool.add.called)
|
||||
server_args = {
|
||||
"format": [('docker', 'tar.xz')],
|
||||
"image_conf": {
|
||||
'image-build': {
|
||||
'install_tree': self.topdir + '/compose/Server/$arch/os',
|
||||
'kickstart': 'fedora-docker-base.ks',
|
||||
'format': 'docker',
|
||||
'repo': self.topdir + '/compose/Server-optional/$arch/os',
|
||||
'variant': compose.all_variants['Server-optional'],
|
||||
'target': 'f24',
|
||||
'disk_size': 3,
|
||||
'name': 'Fedora-Docker-Base',
|
||||
'arches': 'x86_64',
|
||||
'version': 'Rawhide',
|
||||
'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git',
|
||||
'distro': 'Fedora-20',
|
||||
}
|
||||
},
|
||||
"conf_file": self.topdir + '/work/image-build/Server-optional/docker_Fedora-Docker-Base.cfg',
|
||||
"image_dir": self.topdir + '/compose/Server-optional/%(arch)s/images',
|
||||
"relative_image_dir": 'Server-optional/%(arch)s/images',
|
||||
"link_type": 'hardlink-or-copy',
|
||||
"scratch": False,
|
||||
"failable_arches": ['x86_64'],
|
||||
}
|
||||
self.assertItemsEqual(phase.pool.queue_put.mock_calls,
|
||||
[mock.call((compose, server_args))])
|
||||
|
||||
|
||||
class TestCreateImageBuildThread(PungiTestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue