diff --git a/tests/install/conftest.py b/tests/install/conftest.py index aa8bc1b5..15a09d7c 100644 --- a/tests/install/conftest.py +++ b/tests/install/conftest.py @@ -125,6 +125,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 @@ -247,6 +250,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 diff --git a/tests/install/test.py b/tests/install/test.py index d3690599..7784302d 100644 --- a/tests/install/test.py +++ b/tests/install/test.py @@ -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", @@ -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"), @@ -109,7 +110,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, package_source: [dict( vm="vm1", @@ -302,7 +303,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 firmware, version, machine, local_sr, package_source: [ dict(vm="vm1", @@ -331,7 +332,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 firmware, orig_version, machine, package_source, local_sr: [dict( vm="vm1", @@ -366,7 +367,7 @@ def test_upgrade(self, vm_booted_with_installer, install_disk, "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, mode, machine, package_source, local_sr: [dict( vm="vm1", @@ -391,7 +392,7 @@ def test_boot_upg(self, create_vms, ("83rcnet-83rcnet", "83rcnet"), # FIXME ("821.1-821.1", "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, orig_version, local_sr, package_source: [dict( vm="vm1", @@ -422,7 +423,7 @@ def test_restore(self, vm_booted_with_installer, install_disk, "83rcnet-83rcnet", "83rcnet-83rcnet-83rcnet", # FIXME "821.1-821.1-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, mode, package_source, local_sr: [dict( vm="vm1",