Skip to content

Commit 1354df4

Browse files
committed
install: rename fixture install_disk to system_disks_names
Code will be more readable when we start manipulating other info about system disks. Signed-off-by: Yann Dirson <[email protected]>
1 parent 8d9fe61 commit 1354df4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/install/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def installer_iso(request):
9696
)
9797

9898
@pytest.fixture(scope='function')
99-
def install_disk(request):
99+
def system_disks_names(request):
100100
firmware = request.getfixturevalue("firmware")
101101
yield {"uefi": "nvme0n1", "bios": "sda"}[firmware]
102102

tests/install/test.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class TestNested:
7979
vifs=[dict(index=0, network_name=NETWORKS["MGMT"])],
8080
))
8181
@pytest.mark.answerfile(
82-
lambda install_disk, local_sr, package_source, iso_version: AnswerFile("INSTALL")
82+
lambda system_disks_names, local_sr, package_source, iso_version: AnswerFile("INSTALL")
8383
.top_setattr({} if local_sr == "nosr" else {"sr-type": local_sr})
8484
.top_append(
8585
{"iso": {"TAG": "source", "type": "local"},
@@ -89,9 +89,9 @@ class TestNested:
8989
{"TAG": "admin-interface", "name": "eth0", "proto": "dhcp"},
9090
{"TAG": "primary-disk",
9191
"guest-storage": "no" if local_sr == "nosr" else "yes",
92-
"CONTENTS": install_disk},
92+
"CONTENTS": system_disks_names[0]},
9393
))
94-
def test_install(self, vm_booted_with_installer, install_disk,
94+
def test_install(self, vm_booted_with_installer, system_disks_names,
9595
firmware, iso_version, package_source, local_sr):
9696
host_vm = vm_booted_with_installer
9797
installer.monitor_install(ip=host_vm.ip)
@@ -334,15 +334,15 @@ def test_boot_inst(self, create_vms,
334334
vm="vm1",
335335
image_test=f"TestNested::test_boot_inst[{firmware}-{orig_version}-{machine}-{package_source}-{local_sr}]")])
336336
@pytest.mark.answerfile(
337-
lambda install_disk, package_source, iso_version: AnswerFile("UPGRADE").top_append(
337+
lambda system_disks_names, package_source, iso_version: AnswerFile("UPGRADE").top_append(
338338
{"iso": {"TAG": "source", "type": "local"},
339339
"net": {"TAG": "source", "type": "url",
340340
"CONTENTS": ISO_IMAGES[iso_version]['net-url']},
341341
}[package_source],
342342
{"TAG": "existing-installation",
343-
"CONTENTS": install_disk},
343+
"CONTENTS": system_disks_names[0]},
344344
))
345-
def test_upgrade(self, vm_booted_with_installer, install_disk,
345+
def test_upgrade(self, vm_booted_with_installer, system_disks_names,
346346
firmware, orig_version, iso_version, machine, package_source, local_sr):
347347
host_vm = vm_booted_with_installer
348348
installer.monitor_upgrade(ip=host_vm.ip)
@@ -395,11 +395,11 @@ def test_boot_upg(self, create_vms,
395395
vm="vm1",
396396
image_test=f"TestNested::test_boot_upg[{firmware}-{orig_version}-host1-{package_source}-{local_sr}]")])
397397
@pytest.mark.answerfile(
398-
lambda install_disk: AnswerFile("RESTORE").top_append(
398+
lambda system_disks_names: AnswerFile("RESTORE").top_append(
399399
{"TAG": "backup-disk",
400-
"CONTENTS": install_disk},
400+
"CONTENTS": system_disks_names[0]},
401401
))
402-
def test_restore(self, vm_booted_with_installer, install_disk,
402+
def test_restore(self, vm_booted_with_installer, system_disks_names,
403403
firmware, orig_version, iso_version, package_source, local_sr):
404404
host_vm = vm_booted_with_installer
405405
installer.monitor_restore(ip=host_vm.ip)

0 commit comments

Comments
 (0)