[test] Correctly check bootable ISOs
ISO image without MBR and GPT can still be bootable if it has an El Torito boot catalog. The test phase must accept such images. This slightly defeats the point of the check: to verify the ISO is hybrid. However, based on the metadata we have no way to actually tell if the image is supposed to be hybrid. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
f0dca7687e
commit
22e94caf3c
2 changed files with 26 additions and 7 deletions
|
|
@ -23,10 +23,12 @@ FAILABLE_CONFIG = {
|
|||
]
|
||||
}
|
||||
|
||||
UNBOOTABLE_ISO = ('\0' * 0x8001) + 'CD001' + ('\0' * 100)
|
||||
ISO_WITH_MBR = ('\0' * 0x1fe) + '\x55\xAA' + ('\0' * 0x7e01) + 'CD001' + ('\0' * 100)
|
||||
ISO_WITH_GPT = ('\0' * 0x200) + 'EFI PART' + ('\0' * 0x7df9) + 'CD001' + ('\0' * 100)
|
||||
ISO_WITH_MBR_AND_GPT = ('\0' * 0x1fe) + '\x55\xAAEFI PART' + ('\0' * 0x7df9) + 'CD001' + ('\0' * 100)
|
||||
PAD = '\0' * 100
|
||||
UNBOOTABLE_ISO = ('\0' * 0x8001) + 'CD001' + PAD
|
||||
ISO_WITH_MBR = ('\0' * 0x1fe) + '\x55\xAA' + ('\0' * 0x7e01) + 'CD001' + PAD
|
||||
ISO_WITH_GPT = ('\0' * 0x200) + 'EFI PART' + ('\0' * 0x7df9) + 'CD001' + PAD
|
||||
ISO_WITH_MBR_AND_GPT = ('\0' * 0x1fe) + '\x55\xAAEFI PART' + ('\0' * 0x7df9) + 'CD001' + PAD
|
||||
ISO_WITH_TORITO = ('\0' * 0x8001) + 'CD001' + ('\0' * 0x7fa) + '\0CD001\1EL TORITO SPECIFICATION' + PAD
|
||||
|
||||
|
||||
class TestCheckImageSanity(PungiTestCase):
|
||||
|
|
@ -125,6 +127,17 @@ class TestCheckImageSanity(PungiTestCase):
|
|||
except:
|
||||
self.fail('Bootable image with MBR and GPT must not raise')
|
||||
|
||||
def test_bootable_iso_with_el_torito_does_not_raise(self):
|
||||
compose = DummyCompose(self.topdir, {})
|
||||
compose.image.format = 'iso'
|
||||
compose.image.bootable = True
|
||||
touch(os.path.join(self.topdir, 'compose', compose.image.path), ISO_WITH_TORITO)
|
||||
|
||||
try:
|
||||
test_phase.check_image_sanity(compose)
|
||||
except:
|
||||
self.fail('Bootable image with El Torito must not raise')
|
||||
|
||||
def test_checks_with_optional_variant(self):
|
||||
compose = DummyCompose(self.topdir, {})
|
||||
compose.variants['Server'].variants = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue