Skip to content

Commit 24304bb

Browse files
committed
install: add "version" test parameter
1 parent 212e901 commit 24304bb

File tree

1 file changed

+38
-13
lines changed

1 file changed

+38
-13
lines changed

tests/install/test.py

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@ class TestNested:
3838
"source": {"type": "local"},
3939
"primary-disk": {"text": "nvme0n1"},
4040
})
41-
@pytest.mark.installer_iso("xcpng-8.2.1-2023")
42-
def test_install_821_uefi(self, request, iso_remaster, create_vms):
41+
@pytest.mark.parametrize("version", [
42+
pytest.param("821.1", marks=[
43+
pytest.mark.installer_iso("xcpng-8.2.1-2023"),
44+
]),
45+
pytest.param("83b2", marks=[
46+
pytest.mark.installer_iso("xcpng-8.3-beta2"),
47+
]),
48+
])
49+
def test_install_uefi(self, request, iso_remaster, create_vms, version):
4350
assert len(create_vms) == 1
4451
host_vm = create_vms[0]
4552
# FIXME should be part of vm def
@@ -122,19 +129,29 @@ def test_install_821_uefi(self, request, iso_remaster, create_vms):
122129
host_vm.export(xva_name, "zstd", use_cache=CACHE_IMPORTED_VM)
123130

124131

125-
@pytest.mark.parametrize("base", [
126-
pytest.param("install", marks=[
127-
pytest.mark.dependency(depends=["TestNested::test_install_821_uefi"]),
132+
@pytest.mark.parametrize("mode", [
133+
pytest.param("821.1_install", marks=[
134+
pytest.mark.dependency(depends=["TestNested::test_install_uefi[821.1]"]),
135+
pytest.mark.vm_definitions(
136+
dict(name="vm 1", image="install/test::Nested::install_uefi[821.1]")),
137+
]),
138+
pytest.param("821.1_821.1", marks=[
139+
pytest.mark.dependency(depends=["TestNested::test_upgrade_uefi[821.1]"]),
128140
pytest.mark.vm_definitions(
129-
dict(name="vm 1", image="install/test::Nested::install_821_uefi")),
141+
dict(name="vm 1", image="install/test::Nested::upgrade_uefi[821.1]")),
130142
]),
131-
pytest.param("upgrade", marks=[
132-
pytest.mark.dependency(depends=["TestNested::test_upgrade_821_uefi"]),
143+
pytest.param("83b2_install", marks=[
144+
pytest.mark.dependency(depends=["TestNested::test_install_uefi[83b2]"]),
133145
pytest.mark.vm_definitions(
134-
dict(name="vm 1", image="install/test::Nested::upgrade_821_uefi")),
146+
dict(name="vm 1", image="install/test::Nested::install_uefi[83b2]")),
147+
]),
148+
pytest.param("83b2_83b2", marks=[
149+
pytest.mark.dependency(depends=["TestNested::test_upgrade_uefi[83b2]"]),
150+
pytest.mark.vm_definitions(
151+
dict(name="vm 1", image="install/test::Nested::upgrade_uefi[83b2]")),
135152
]),
136153
])
137-
def test_firstboot_821_uefi(self, request, create_vms, base):
154+
def test_firstboot_uefi(self, request, create_vms, mode):
138155
host_vm = create_vms[0]
139156
vif = host_vm.vifs()[0]
140157
mac_address = vif.param_get('MAC')
@@ -233,7 +250,16 @@ def test_firstboot_821_uefi(self, request, create_vms, base):
233250
host_vm.host.ssh(["rm -f", xva_name])
234251
host_vm.export(xva_name, "zstd", use_cache=CACHE_IMPORTED_VM)
235252

236-
@pytest.mark.dependency(depends=["TestNested::test_firstboot_821_uefi[install]"])
253+
@pytest.mark.parametrize("version", [
254+
pytest.param("821.1", marks=[
255+
pytest.mark.dependency(depends=["TestNested::test_firstboot_uefi[821.1_install]"]),
256+
pytest.mark.installer_iso("xcpng-8.2.1-2023"),
257+
]),
258+
pytest.param("83b2", marks=[
259+
pytest.mark.dependency(depends=["TestNested::test_firstboot_uefi[83b2_install]"]),
260+
pytest.mark.installer_iso("xcpng-8.3-beta2"),
261+
]),
262+
])
237263
@pytest.mark.vm_definitions(
238264
dict(name="vm 1",
239265
image="install/test::Nested::firstboot_821_uefi[install]"
@@ -244,8 +270,7 @@ def test_firstboot_821_uefi(self, request, create_vms, base):
244270
"source": {"type": "local"},
245271
"existing-installation": {"text": "nvme0n1"},
246272
})
247-
@pytest.mark.installer_iso("xcpng-8.2.1-2023")
248-
def test_upgrade_821_uefi(self, request, iso_remaster, create_vms):
273+
def test_upgrade_uefi(self, request, iso_remaster, create_vms, version):
249274
host_vm = create_vms[0]
250275
vif = host_vm.vifs()[0]
251276
mac_address = vif.param_get('MAC')

0 commit comments

Comments
 (0)