[test] Only check bootability for images on x86_64 and i386

Current check does not really work for other arches.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-08-10 13:02:56 +02:00
parent 247149d4e1
commit ef99e28849
2 changed files with 19 additions and 2 deletions

View File

@ -133,7 +133,11 @@ def check(compose, variant, arch, image):
if image.format == 'iso' and not iso: if image.format == 'iso' and not iso:
result = False result = False
raise RuntimeError('%s does not look like an ISO file' % path) 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 result = False
raise RuntimeError( raise RuntimeError(
'%s is supposed to be bootable, but does not have MBR nor ' '%s is supposed to be bootable, but does not have MBR nor '

View File

@ -65,8 +65,9 @@ class TestCheckImageSanity(PungiTestCase):
self.assertIn('does not look like an ISO file', str(ctx.exception)) 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 = DummyCompose(self.topdir, {})
compose.image.arch = 'x86_64'
compose.image.format = 'iso' compose.image.format = 'iso'
compose.image.bootable = True compose.image.bootable = True
touch(os.path.join(self.topdir, 'compose', compose.image.path), UNBOOTABLE_ISO) 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', self.assertIn('is supposed to be bootable, but does not have MBR nor GPT',
str(ctx.exception)) 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): def test_failable_bootable_iso_without_mbr_gpt_doesnt_raise(self):
compose = DummyCompose(self.topdir, {}) compose = DummyCompose(self.topdir, {})
compose.image.format = 'iso' compose.image.format = 'iso'