Merge pull request #1775 from mwhudson/no-uefi-no-core-boot
Do not offer core boot based installs unless bootloader is UEFI
This commit is contained in:
commit
c8fde0745b
|
@ -375,6 +375,9 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
if not self.app.opts.enhanced_secureboot:
|
||||
log.debug("Not offering enhanced_secureboot: commandline disabled")
|
||||
continue
|
||||
if self.model.bootloader != Bootloader.UEFI:
|
||||
log.debug("Not offering core boot based install: not a UEFI system")
|
||||
continue
|
||||
info = self.info_for_system(name, label, system)
|
||||
if info is not None:
|
||||
self._variation_info[name] = info
|
||||
|
|
|
@ -673,6 +673,33 @@ class TestCore(TestAPI):
|
|||
with self.assertRaises(ClientResponseError):
|
||||
await inst.post("/storage/v2/guided", data)
|
||||
|
||||
@timeout()
|
||||
async def test_basic_no_core_boot_bios(self):
|
||||
cfg = self.machineConfig("examples/machines/simple.json")
|
||||
with cfg.edit() as data:
|
||||
attrs = data["storage"]["blockdev"]["/dev/sda"]["attrs"]
|
||||
attrs["size"] = str(25 << 30)
|
||||
kw = dict(
|
||||
bootloader="bios",
|
||||
extra_args=[
|
||||
"--storage-version",
|
||||
"2",
|
||||
"--source-catalog",
|
||||
"examples/sources/install-canary.yaml",
|
||||
"--dry-run-config",
|
||||
"examples/dry-run-configs/tpm.yaml",
|
||||
],
|
||||
)
|
||||
async with start_server(cfg, **kw) as inst:
|
||||
await inst.post("/source", source_id="ubuntu-desktop")
|
||||
resp = await inst.get("/storage/v2/guided", wait=True)
|
||||
[reformat, manual] = resp["targets"]
|
||||
for capability in reformat["allowed"]:
|
||||
self.assertNotIn("CORE_BOOT", capability)
|
||||
data = dict(target=reformat, capability="CORE_BOOT_ENCRYPTED")
|
||||
with self.assertRaises(ClientResponseError):
|
||||
await inst.post("/storage/v2/guided", data)
|
||||
|
||||
|
||||
class TestAdd(TestAPI):
|
||||
@timeout()
|
||||
|
|
Loading…
Reference in New Issue