Skip to content

Commit

Permalink
install: add "version" test parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ydirson committed Jun 13, 2024
1 parent 212e901 commit 24304bb
Showing 1 changed file with 38 additions and 13 deletions.
51 changes: 38 additions & 13 deletions tests/install/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ class TestNested:
"source": {"type": "local"},
"primary-disk": {"text": "nvme0n1"},
})
@pytest.mark.installer_iso("xcpng-8.2.1-2023")
def test_install_821_uefi(self, request, iso_remaster, create_vms):
@pytest.mark.parametrize("version", [
pytest.param("821.1", marks=[
pytest.mark.installer_iso("xcpng-8.2.1-2023"),
]),
pytest.param("83b2", marks=[
pytest.mark.installer_iso("xcpng-8.3-beta2"),
]),
])
def test_install_uefi(self, request, iso_remaster, create_vms, version):
assert len(create_vms) == 1
host_vm = create_vms[0]
# FIXME should be part of vm def
Expand Down Expand Up @@ -122,19 +129,29 @@ def test_install_821_uefi(self, request, iso_remaster, create_vms):
host_vm.export(xva_name, "zstd", use_cache=CACHE_IMPORTED_VM)


@pytest.mark.parametrize("base", [
pytest.param("install", marks=[
pytest.mark.dependency(depends=["TestNested::test_install_821_uefi"]),
@pytest.mark.parametrize("mode", [
pytest.param("821.1_install", marks=[
pytest.mark.dependency(depends=["TestNested::test_install_uefi[821.1]"]),
pytest.mark.vm_definitions(
dict(name="vm 1", image="install/test::Nested::install_uefi[821.1]")),
]),
pytest.param("821.1_821.1", marks=[
pytest.mark.dependency(depends=["TestNested::test_upgrade_uefi[821.1]"]),
pytest.mark.vm_definitions(
dict(name="vm 1", image="install/test::Nested::install_821_uefi")),
dict(name="vm 1", image="install/test::Nested::upgrade_uefi[821.1]")),
]),
pytest.param("upgrade", marks=[
pytest.mark.dependency(depends=["TestNested::test_upgrade_821_uefi"]),
pytest.param("83b2_install", marks=[
pytest.mark.dependency(depends=["TestNested::test_install_uefi[83b2]"]),
pytest.mark.vm_definitions(
dict(name="vm 1", image="install/test::Nested::upgrade_821_uefi")),
dict(name="vm 1", image="install/test::Nested::install_uefi[83b2]")),
]),
pytest.param("83b2_83b2", marks=[
pytest.mark.dependency(depends=["TestNested::test_upgrade_uefi[83b2]"]),
pytest.mark.vm_definitions(
dict(name="vm 1", image="install/test::Nested::upgrade_uefi[83b2]")),
]),
])
def test_firstboot_821_uefi(self, request, create_vms, base):
def test_firstboot_uefi(self, request, create_vms, mode):
host_vm = create_vms[0]
vif = host_vm.vifs()[0]
mac_address = vif.param_get('MAC')
Expand Down Expand Up @@ -233,7 +250,16 @@ def test_firstboot_821_uefi(self, request, create_vms, base):
host_vm.host.ssh(["rm -f", xva_name])
host_vm.export(xva_name, "zstd", use_cache=CACHE_IMPORTED_VM)

@pytest.mark.dependency(depends=["TestNested::test_firstboot_821_uefi[install]"])
@pytest.mark.parametrize("version", [
pytest.param("821.1", marks=[
pytest.mark.dependency(depends=["TestNested::test_firstboot_uefi[821.1_install]"]),
pytest.mark.installer_iso("xcpng-8.2.1-2023"),
]),
pytest.param("83b2", marks=[
pytest.mark.dependency(depends=["TestNested::test_firstboot_uefi[83b2_install]"]),
pytest.mark.installer_iso("xcpng-8.3-beta2"),
]),
])
@pytest.mark.vm_definitions(
dict(name="vm 1",
image="install/test::Nested::firstboot_821_uefi[install]"
Expand All @@ -244,8 +270,7 @@ def test_firstboot_821_uefi(self, request, create_vms, base):
"source": {"type": "local"},
"existing-installation": {"text": "nvme0n1"},
})
@pytest.mark.installer_iso("xcpng-8.2.1-2023")
def test_upgrade_821_uefi(self, request, iso_remaster, create_vms):
def test_upgrade_uefi(self, request, iso_remaster, create_vms, version):
host_vm = create_vms[0]
vif = host_vm.vifs()[0]
mac_address = vif.param_get('MAC')
Expand Down

0 comments on commit 24304bb

Please sign in to comment.