Skip to content

Commit e0eb305

Browse files
committed
WIP XVA names depend on test name
FIXME: should be folded into other commits?
1 parent 9e9727a commit e0eb305

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

tests/install/test_install.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TestInstallNested:
3939
"primary-disk": {"text": "nvme0n1"},
4040
})
4141
@pytest.mark.installer_iso("xcpng-8.2.1-2023")
42-
def test_install_nested_821_uefi(self, iso_remaster, create_vms):
42+
def test_install_nested_821_uefi(self, request, iso_remaster, create_vms):
4343
assert len(create_vms) == 1
4444
host_vm = create_vms[0]
4545
# FIXME should be part of vm def
@@ -117,22 +117,24 @@ def test_install_nested_821_uefi(self, iso_remaster, create_vms):
117117
# record this state
118118
# FIXME move to fixture
119119
# FIXME where to store?
120-
host_vm.host.ssh(["rm -f test_install_nested_821_uefi-vm1.xva"])
121-
host_vm.export("test_install_nested_821_uefi-vm1.xva", "zstd",
122-
use_cache=CACHE_IMPORTED_VM)
120+
xva_name = request.node.nodeid + ".xva"
121+
host_vm.host.ssh(["rm -f", xva_name])
122+
host_vm.export(xva_name, "zstd", use_cache=CACHE_IMPORTED_VM)
123123

124124

125125
@pytest.mark.parametrize("base", [
126-
pytest.param("install", marks=pytest.mark.dependency(
127-
depends=["TestInstallNested::test_install_nested_821_uefi"])),
128-
pytest.param("upgrade", marks=pytest.mark.dependency(
129-
depends=["TestInstallNested::test_upgrade_nested_821_uefi"])),
126+
pytest.param("install", marks=[
127+
pytest.mark.dependency(depends=["TestInstallNested::test_install_nested_821_uefi"]),
128+
pytest.mark.vm_definitions(
129+
dict(name="vm 1", image="tests/install/test_install.py::TestInstallNested::test_install_nested_821_uefi.xva")),
130+
]),
131+
pytest.param("upgrade", marks=[
132+
pytest.mark.dependency(depends=["TestInstallNested::test_upgrade_nested_821_uefi"]),
133+
pytest.mark.vm_definitions(
134+
dict(name="vm 1", image="tests/install/test_install.py::TestInstallNested::test_upgrade_nested_821_uefi.xva")),
135+
]),
130136
])
131-
@pytest.mark.vm_definitions(
132-
dict(name="vm 1",
133-
image="test_install_nested_821_uefi-vm1.xva"
134-
))
135-
def test_firstboot_nested_821_uefi(self, create_vms, base):
137+
def test_firstboot_nested_821_uefi(self, request, create_vms, base):
136138
host_vm = create_vms[0]
137139
vif = host_vm.vifs()[0]
138140
mac_address = vif.param_get('MAC')
@@ -227,14 +229,14 @@ def test_firstboot_nested_821_uefi(self, create_vms, base):
227229
# record this state
228230
# FIXME move to fixture
229231
# FIXME where to store?
230-
host_vm.host.ssh(["rm -f test_firstboot_nested_821_uefi-vm1.xva"])
231-
host_vm.export("test_firstboot_nested_821_uefi-vm1.xva", "zstd",
232-
use_cache=CACHE_IMPORTED_VM)
232+
xva_name = request.node.nodeid + ".xva"
233+
host_vm.host.ssh(["rm -f", xva_name])
234+
host_vm.export(xva_name, "zstd", use_cache=CACHE_IMPORTED_VM)
233235

234236
@pytest.mark.dependency(depends=["TestInstallNested::test_firstboot_nested_821_uefi[install]"])
235237
@pytest.mark.vm_definitions(
236238
dict(name="vm 1",
237-
image="test_firstboot_nested_821_uefi-vm1.xva"
239+
image="tests/install/test_install.py::TestInstallNested::test_firstboot_nested_821_uefi[install].xva"
238240
))
239241
@pytest.mark.answerfile(
240242
{
@@ -243,7 +245,7 @@ def test_firstboot_nested_821_uefi(self, create_vms, base):
243245
"existing-installation": {"text": "nvme0n1"},
244246
})
245247
@pytest.mark.installer_iso("xcpng-8.2.1-2023")
246-
def test_upgrade_nested_821_uefi(self, iso_remaster, create_vms):
248+
def test_upgrade_nested_821_uefi(self, request, iso_remaster, create_vms):
247249
host_vm = create_vms[0]
248250
vif = host_vm.vifs()[0]
249251
mac_address = vif.param_get('MAC')
@@ -323,6 +325,6 @@ def test_upgrade_nested_821_uefi(self, iso_remaster, create_vms):
323325
# record this state
324326
# FIXME move to fixture
325327
# FIXME where to store?
326-
host_vm.host.ssh(["rm -f test_upgrade_nested_821_uefi-vm1.xva"])
327-
host_vm.export("test_upgrade_nested_821_uefi-vm1.xva", "zstd",
328-
use_cache=CACHE_IMPORTED_VM)
328+
xva_name = request.node.nodeid + ".xva"
329+
host_vm.host.ssh(["rm -f", xva_name])
330+
host_vm.export(xva_name, "zstd", use_cache=CACHE_IMPORTED_VM)

0 commit comments

Comments
 (0)