Skip to content

Commit

Permalink
WIP installation on a disk with a MBR partition
Browse files Browse the repository at this point in the history
  • Loading branch information
ydirson committed Oct 4, 2024
1 parent c4bec75 commit 21ca192
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
15 changes: 15 additions & 0 deletions tests/install/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def answerfile_maybe_tweak_parttable(request, answerfile):
if firmware.endswith("+dell"):
answerfile.top_append(dict(TAG="script", stage="installation-start",
type="url", CONTENTS="file:///root/preinstall-utilitypart.sh"))
if firmware.endswith("+mbr"):
answerfile.top_append(dict(TAG="script", stage="installation-start",
type="url", CONTENTS="file:///root/preinstall-mbrparttable.sh"))

# Remasters the ISO sepecified by `installer_iso` mark, with:
# - network and ssh support activated, and .ssh/authorized_key so tests can
Expand Down Expand Up @@ -256,6 +259,18 @@ def remastered_iso(installer_iso, answerfile, install_disk):
EOP
EOF
cat > "$INSTALLIMG/root/preinstall-mbrparttable.sh" <<'EOF'
#!/bin/sh
set -ex
# Dell utility partition
sgdisk --zap-all /dev/{install_disk}
sfdisk /dev/{install_disk} << 'EOP'
unit: sectors
p1 : start= 2048, size= 32768, Id=83
EOP
EOF
cat > "$INSTALLIMG/root/postinstall.sh" <<'EOF'
#!/bin/sh
set -ex
Expand Down
11 changes: 6 additions & 5 deletions tests/install/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestNested:
"xs8", "ch821.1",
"xs70",
))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
@pytest.mark.vm_definitions(lambda firmware: dict(
name="vm1",
template="Other install media",
Expand All @@ -45,6 +45,7 @@ class TestNested:
),
"bios": (),
"bios+dell": (),
"bios+mbr": (),
}[firmware],
vdis=[dict(name="vm1 system disk", size="100GiB", device="xvda", userdevice="0")],
cd_vbd=dict(device="xvdd", userdevice="3"),
Expand Down Expand Up @@ -104,7 +105,7 @@ def helper_vm_with_plugged_disk(running_vm, create_vms):
"ch821.1", "xs8",
"xs70",
))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
@pytest.mark.continuation_of(lambda version, firmware, local_sr, source_type: [dict(
vm="vm1",
image_test=f"TestNested::test_install[{firmware}-{version}-{source_type}-{local_sr}]")],
Expand Down Expand Up @@ -297,7 +298,7 @@ def _test_firstboot(self, create_vms, mode, *, machine='DEFAULT'):
"ch821.1", "xs8",
"xs70",
))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
@pytest.mark.continuation_of(
lambda version, firmware, machine, local_sr, source_type: [
dict(vm="vm1",
Expand Down Expand Up @@ -326,7 +327,7 @@ def test_boot_inst(self, create_vms,
"821.1-821.1",
"75-821.1",
))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
@pytest.mark.continuation_of(lambda mode, firmware, machine, source_type, local_sr: [dict(
vm="vm1",
image_test=(f"TestNested::test_upgrade[{firmware}-{mode}-{machine}-{source_type}-{local_sr}]"))],
Expand Down Expand Up @@ -382,7 +383,7 @@ def test_boot_rst(self, create_vms,
("821.1", "821.1"),
("75", "821.1"),
])
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell"))
@pytest.mark.parametrize("firmware", ("uefi", "bios", "bios+dell", "bios+mbr"))
@pytest.mark.continuation_of(lambda firmware, params, machine, source_type, local_sr: [dict(
vm="vm1",
image_test=(f"TestNested::test_boot_{'upg' if '-' in params else 'inst'}"
Expand Down

0 comments on commit 21ca192

Please sign in to comment.