From 452da866496e4d7270131f85c8d380c8353ddb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 26 Feb 2016 11:30:37 +0100 Subject: [PATCH] [buildinstall] Use -dvd- in volume ids instead of -boot- MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- pungi/phases/buildinstall.py | 6 +++--- tests/test_buildinstall.py | 34 ++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index afec31d8..0eb7d752 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -125,19 +125,19 @@ class BuildinstallPhase(PhaseBase): repo_baseurl = self.compose.paths.work.arch_repo(arch) output_dir = self.compose.paths.work.buildinstall_dir(arch) - volid = get_volid(self.compose, arch, disc_type="boot") buildarch = get_valid_arches(arch)[0] if buildinstall_method == "lorax": for variant in self.compose.get_variants(arch=arch, types=['variant']): if variant.is_empty: continue - volid = get_volid(self.compose, arch, variant=variant, disc_type="boot") + volid = get_volid(self.compose, arch, variant=variant, disc_type="dvd") commands.append( (variant, self._get_lorax_cmd(repo_baseurl, output_dir, variant, arch, buildarch, volid)) ) elif buildinstall_method == "buildinstall": + volid = get_volid(self.compose, arch, disc_type="dvd") commands.append( (None, lorax.get_buildinstall_cmd(product, @@ -181,7 +181,7 @@ class BuildinstallPhase(PhaseBase): os_tree = self.compose.paths.compose.os_tree(arch, variant) # TODO: label is not used label = "" - volid = get_volid(self.compose, arch, variant, escape_spaces=False, disc_type="boot") + volid = get_volid(self.compose, arch, variant, escape_spaces=False, disc_type="dvd") tweak_buildinstall(buildinstall_dir, os_tree, arch, variant.uid, label, volid, kickstart_file) symlink_boot_iso(self.compose, arch, variant) diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index 5b91b4f7..68f6f257 100755 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -89,6 +89,11 @@ class TestBuildinstallPhase(PungiTestCase): buildarch='amd64', is_final=True, nomacboot=True, noupgrade=True, volid='vol_id', variant='Client', buildinstallpackages=[], bugurl=None)]) + self.assertItemsEqual( + get_volid.mock_calls, + [mock.call(compose, 'x86_64', variant=compose.variants['Server'], disc_type='dvd'), + mock.call(compose, 'amd64', variant=compose.variants['Client'], disc_type='dvd'), + mock.call(compose, 'amd64', variant=compose.variants['Server'], disc_type='dvd')]) @mock.patch('pungi.phases.buildinstall.ThreadPool') @mock.patch('pungi.phases.buildinstall.LoraxWrapper') @@ -122,6 +127,9 @@ class TestBuildinstallPhase(PungiTestCase): volid='vol_id', variant='Client', buildinstallpackages=[], bugurl=None)], any_order=True) + self.assertItemsEqual( + get_volid.mock_calls, + [mock.call(compose, 'amd64', variant=compose.variants['Client'], disc_type='dvd')]) @mock.patch('pungi.phases.buildinstall.ThreadPool') @mock.patch('pungi.phases.buildinstall.LoraxWrapper') @@ -155,6 +163,10 @@ class TestBuildinstallPhase(PungiTestCase): mock.call('Test', '1', '1', self.topdir + '/work/amd64/repo', self.topdir + '/work/amd64/buildinstall', buildarch='amd64', is_final=True, volid='vol_id')]) + self.assertItemsEqual( + get_volid.mock_calls, + [mock.call(compose, 'x86_64', disc_type='dvd'), + mock.call(compose, 'amd64', disc_type='dvd')]) def test_global_upgrade_with_lorax(self): compose = BuildInstallCompose(self.topdir, { @@ -237,6 +249,11 @@ class TestBuildinstallPhase(PungiTestCase): buildarch='amd64', is_final=True, nomacboot=False, noupgrade=True, volid='vol_id', variant='Client', buildinstallpackages=[], bugurl=None)]) + self.assertItemsEqual( + get_volid.mock_calls, + [mock.call(compose, 'x86_64', variant=compose.variants['Server'], disc_type='dvd'), + mock.call(compose, 'amd64', variant=compose.variants['Client'], disc_type='dvd'), + mock.call(compose, 'amd64', variant=compose.variants['Server'], disc_type='dvd')]) @mock.patch('pungi.phases.buildinstall.ThreadPool') @mock.patch('pungi.phases.buildinstall.LoraxWrapper') @@ -286,6 +303,11 @@ class TestBuildinstallPhase(PungiTestCase): buildarch='amd64', is_final=True, nomacboot=True, noupgrade=False, volid='vol_id', variant='Client', buildinstallpackages=[], bugurl=None)]) + self.assertItemsEqual( + get_volid.mock_calls, + [mock.call(compose, 'x86_64', variant=compose.variants['Server'], disc_type='dvd'), + mock.call(compose, 'amd64', variant=compose.variants['Client'], disc_type='dvd'), + mock.call(compose, 'amd64', variant=compose.variants['Server'], disc_type='dvd')]) class TestCopyFiles(PungiTestCase): @@ -312,9 +334,9 @@ class TestCopyFiles(PungiTestCase): self.assertItemsEqual( get_volid.mock_calls, - [mock.call(compose, 'x86_64', compose.variants['Server'], escape_spaces=False, disc_type='boot'), - mock.call(compose, 'amd64', compose.variants['Client'], escape_spaces=False, disc_type='boot'), - mock.call(compose, 'amd64', compose.variants['Server'], escape_spaces=False, disc_type='boot')]) + [mock.call(compose, 'x86_64', compose.variants['Server'], escape_spaces=False, disc_type='dvd'), + mock.call(compose, 'amd64', compose.variants['Client'], escape_spaces=False, disc_type='dvd'), + mock.call(compose, 'amd64', compose.variants['Server'], escape_spaces=False, disc_type='dvd')]) self.assertItemsEqual( tweak_buildinstall.mock_calls, [mock.call(self.topdir + '/work/x86_64/buildinstall', @@ -354,9 +376,9 @@ class TestCopyFiles(PungiTestCase): self.assertItemsEqual( get_volid.mock_calls, - [mock.call(compose, 'x86_64', compose.variants['Server'], escape_spaces=False, disc_type='boot'), - mock.call(compose, 'amd64', compose.variants['Client'], escape_spaces=False, disc_type='boot'), - mock.call(compose, 'amd64', compose.variants['Server'], escape_spaces=False, disc_type='boot')]) + [mock.call(compose, 'x86_64', compose.variants['Server'], escape_spaces=False, disc_type='dvd'), + mock.call(compose, 'amd64', compose.variants['Client'], escape_spaces=False, disc_type='dvd'), + mock.call(compose, 'amd64', compose.variants['Server'], escape_spaces=False, disc_type='dvd')]) self.assertItemsEqual( tweak_buildinstall.mock_calls, [mock.call(self.topdir + '/work/x86_64/buildinstall/Server',