From ef99e288498ab34697facf12f4ad886431ac7ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 10 Aug 2016 13:02:56 +0200 Subject: [PATCH] [test] Only check bootability for images on x86_64 and i386 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current check does not really work for other arches. Signed-off-by: Lubomír Sedlář --- pungi/phases/test.py | 6 +++++- tests/test_test_phase.py | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pungi/phases/test.py b/pungi/phases/test.py index 61cbf199..7e8993ec 100644 --- a/pungi/phases/test.py +++ b/pungi/phases/test.py @@ -133,7 +133,11 @@ def check(compose, variant, arch, image): if image.format == 'iso' and not iso: result = False raise RuntimeError('%s does not look like an ISO file' % path) - if image.bootable and not has_mbr(f) and not has_gpt(f) and not (iso and has_eltorito(f)): + if (image.arch in ('x86_64', 'i386') and + image.bootable and + not has_mbr(f) and + not has_gpt(f) and + not (iso and has_eltorito(f))): result = False raise RuntimeError( '%s is supposed to be bootable, but does not have MBR nor ' diff --git a/tests/test_test_phase.py b/tests/test_test_phase.py index 7780068e..c2d4a9a2 100755 --- a/tests/test_test_phase.py +++ b/tests/test_test_phase.py @@ -65,8 +65,9 @@ class TestCheckImageSanity(PungiTestCase): self.assertIn('does not look like an ISO file', str(ctx.exception)) - def test_bootable_iso_without_mbr_or_gpt_raises(self): + def test_bootable_iso_without_mbr_or_gpt_raises_on_x86_64(self): compose = DummyCompose(self.topdir, {}) + compose.image.arch = 'x86_64' compose.image.format = 'iso' compose.image.bootable = True touch(os.path.join(self.topdir, 'compose', compose.image.path), UNBOOTABLE_ISO) @@ -77,6 +78,18 @@ class TestCheckImageSanity(PungiTestCase): self.assertIn('is supposed to be bootable, but does not have MBR nor GPT', str(ctx.exception)) + def test_bootable_iso_without_mbr_or_gpt_doesnt_raise_on_arm(self): + compose = DummyCompose(self.topdir, {}) + compose.image.arch = 'armhfp' + compose.image.format = 'iso' + compose.image.bootable = True + touch(os.path.join(self.topdir, 'compose', compose.image.path), UNBOOTABLE_ISO) + + try: + test_phase.check_image_sanity(compose) + except: + self.fail('Failable deliverable must not raise') + def test_failable_bootable_iso_without_mbr_gpt_doesnt_raise(self): compose = DummyCompose(self.topdir, {}) compose.image.format = 'iso'