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 8, 2024
1 parent c94ca7b commit 9029741
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 @@ -129,6 +129,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 @@ -251,6 +254,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 @@ -32,7 +32,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",
Expand All @@ -53,6 +53,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 @@ -113,7 +114,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",
Expand Down Expand Up @@ -307,7 +308,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 @@ -337,7 +338,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",
Expand Down Expand Up @@ -395,7 +396,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",
Expand Down

0 comments on commit 9029741

Please sign in to comment.