Skip to content

Commit cfe1394

Browse files
committed
WIP installation on a disk with a MBR partition
1 parent ad2b4d2 commit cfe1394

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

tests/install/conftest.py

+15
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ def answerfile_maybe_tweak_parttable(request, answerfile):
124124
if firmware.endswith("+dell"):
125125
answerfile.top_append(dict(TAG="script", stage="installation-start",
126126
type="url", CONTENTS="file:///root/preinstall-utilitypart.sh"))
127+
if firmware.endswith("+mbr"):
128+
answerfile.top_append(dict(TAG="script", stage="installation-start",
129+
type="url", CONTENTS="file:///root/preinstall-mbrparttable.sh"))
127130

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

tests/install/test.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class TestNested:
5252
"xs8", "ch821.1",
5353
"xs70",
5454
))
55-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
55+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
5656
@pytest.mark.vm_definitions(
5757
lambda firmware: dict(
5858
name="vm1",
@@ -74,6 +74,7 @@ class TestNested:
7474
),
7575
"bios": (),
7676
"bios+dell": (),
77+
"bios+mbr": (),
7778
}[firmware],
7879
vdis=[dict(name="vm1 system disk", size="100GiB", device="xvda", userdevice="0")],
7980
cd_vbd=dict(device="xvdd", userdevice="3"),
@@ -111,7 +112,7 @@ def test_install(self, answerfile_maybe_tweak_parttable,
111112
"ch821.1", "xs8",
112113
"xs70",
113114
))
114-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
115+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
115116
@pytest.mark.continuation_of(
116117
lambda version, firmware, local_sr, package_source: [dict(
117118
vm="vm1",
@@ -306,7 +307,7 @@ def _test_firstboot(self, create_vms, mode, *, machine='DEFAULT', is_restore=Fal
306307
"ch821.1", "xs8",
307308
"xs70",
308309
))
309-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
310+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
310311
@pytest.mark.continuation_of(
311312
lambda firmware, version, machine, local_sr, package_source: [
312313
dict(vm="vm1",
@@ -335,7 +336,7 @@ def test_boot_inst(self, create_vms,
335336
("821.1", "821.1"),
336337
("75", "821.1"),
337338
])
338-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
339+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
339340
@pytest.mark.continuation_of(
340341
lambda firmware, orig_version, machine, package_source, local_sr: [dict(
341342
vm="vm1",
@@ -370,7 +371,7 @@ def test_upgrade(self, vm_booted_with_installer, install_disk,
370371
"821.1-821.1",
371372
"75-821.1",
372373
))
373-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
374+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
374375
@pytest.mark.continuation_of(
375376
lambda firmware, mode, machine, package_source, local_sr: [dict(
376377
vm="vm1",
@@ -395,7 +396,7 @@ def test_boot_upg(self, create_vms,
395396
("821.1-82nightly", "82nightly"),
396397
("821.1-821.1", "821.1"),
397398
])
398-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
399+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
399400
@pytest.mark.continuation_of(
400401
lambda firmware, orig_version, local_sr, package_source: [dict(
401402
vm="vm1",
@@ -424,7 +425,7 @@ def test_restore(self, vm_booted_with_installer, install_disk,
424425
"830net-830net", "830net-830net-830net", # FIXME
425426
"821.1-821.1-821.1",
426427
))
427-
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
428+
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
428429
@pytest.mark.continuation_of(
429430
lambda firmware, mode, package_source, local_sr: [dict(
430431
vm="vm1",

0 commit comments

Comments
 (0)