Skip to content

Commit c966f62

Browse files
committed
WIP installation on a disk with a MBR partition
1 parent 76e1f49 commit c966f62

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

tests/install/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ def answerfile_maybe_tweak_parttable(request, answerfile):
125125
if firmware.endswith("+dell"):
126126
answerfile.top_append(dict(TAG="script", stage="installation-start",
127127
type="url", CONTENTS="file:///root/preinstall-utilitypart.sh"))
128+
if firmware.endswith("+mbr"):
129+
answerfile.top_append(dict(TAG="script", stage="installation-start",
130+
type="url", CONTENTS="file:///root/preinstall-mbrparttable.sh"))
128131

129132
# Remasters the ISO sepecified by `installer_iso` mark, with:
130133
# - network and ssh support activated, and .ssh/authorized_key so tests can
@@ -247,6 +250,18 @@ def remastered_iso(installer_iso, answerfile, install_disk):
247250
EOP
248251
EOF
249252
253+
cat > "$INSTALLIMG/root/preinstall-mbrparttable.sh" <<'EOF'
254+
#!/bin/sh
255+
set -ex
256+
257+
# Dell utility partition
258+
sgdisk --zap-all /dev/{install_disk}
259+
sfdisk /dev/{install_disk} << 'EOP'
260+
unit: sectors
261+
p1 : start= 2048, size= 32768, Id=83
262+
EOP
263+
EOF
264+
250265
cat > "$INSTALLIMG/root/postinstall.sh" <<'EOF'
251266
#!/bin/sh
252267
set -ex

tests/install/test.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TestNested:
3232
"xs8", "ch821.1",
3333
"xs70",
3434
))
35-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
35+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
3636
@pytest.mark.vm_definitions(
3737
lambda firmware: dict(
3838
name="vm1",
@@ -53,6 +53,7 @@ class TestNested:
5353
),
5454
"bios": (),
5555
"bios+dell": (),
56+
"bios+mbr": (),
5657
}[firmware],
5758
vdis=[dict(name="vm1 system disk", size="100GiB", device="xvda", userdevice="0")],
5859
cd_vbd=dict(device="xvdd", userdevice="3"),
@@ -109,7 +110,7 @@ def helper_vm_with_plugged_disk(running_vm, create_vms):
109110
"ch821.1", "xs8",
110111
"xs70",
111112
))
112-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
113+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
113114
@pytest.mark.continuation_of(
114115
lambda version, firmware, local_sr, source_type: [dict(
115116
vm="vm1",
@@ -302,7 +303,7 @@ def _test_firstboot(self, create_vms, mode, *, machine='DEFAULT'):
302303
"ch821.1", "xs8",
303304
"xs70",
304305
))
305-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
306+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
306307
@pytest.mark.continuation_of(
307308
lambda firmware, version, machine, local_sr, source_type: [
308309
dict(vm="vm1",
@@ -331,7 +332,7 @@ def test_boot_inst(self, create_vms,
331332
("821.1", "821.1"),
332333
("75", "821.1"),
333334
])
334-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
335+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
335336
@pytest.mark.continuation_of(
336337
lambda firmware, orig_version, machine, source_type, local_sr: [dict(
337338
vm="vm1",
@@ -366,7 +367,7 @@ def test_upgrade(self, vm_booted_with_installer, install_disk,
366367
"821.1-821.1",
367368
"75-821.1",
368369
))
369-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
370+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
370371
@pytest.mark.continuation_of(
371372
lambda firmware, mode, machine, source_type, local_sr: [dict(
372373
vm="vm1",
@@ -391,7 +392,7 @@ def test_boot_upg(self, create_vms,
391392
("83rcnet-83rcnet", "83rcnet"), # FIXME
392393
("821.1-821.1", "821.1"),
393394
])
394-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
395+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
395396
@pytest.mark.continuation_of(
396397
lambda firmware, orig_version, local_sr, source_type: [dict(
397398
vm="vm1",
@@ -422,7 +423,7 @@ def test_restore(self, vm_booted_with_installer, install_disk,
422423
"83rcnet-83rcnet", "83rcnet-83rcnet-83rcnet", # FIXME
423424
"821.1-821.1-821.1",
424425
))
425-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
426+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
426427
@pytest.mark.continuation_of(
427428
lambda firmware, mode, source_type, local_sr: [dict(
428429
vm="vm1",

0 commit comments

Comments
 (0)