Skip to content

Commit 9751440

Browse files
committed
Add local_sr parameter to test_install
Signed-off-by: Yann Dirson <[email protected]>
1 parent 93ab539 commit 9751440

File tree

4 files changed

+39
-28
lines changed

4 files changed

+39
-28
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
tests/install/test.py::TestNested::test_restore[uefi-83nightly-83nightly-83nightly]
2-
tests/install/test.py::TestNested::test_boot_rst[uefi-83nightly-83nightly-83nightly]
1+
tests/install/test.py::TestNested::test_restore[uefi-83nightly-83nightly-83nightly-ext]
2+
tests/install/test.py::TestNested::test_boot_rst[uefi-83nightly-83nightly-83nightly-ext]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
tests/install/test.py::TestNested::test_upgrade[uefi-83nightly-83nightly-host1]
2-
tests/install/test.py::TestNested::test_boot_upg[uefi-83nightly-83nightly-host1]
1+
tests/install/test.py::TestNested::test_upgrade[uefi-83nightly-83nightly-host1-ext]
2+
tests/install/test.py::TestNested::test_boot_upg[uefi-83nightly-83nightly-host1-ext]

tests/install/test-sequences/inst.lst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
tests/install/test.py::TestNested::test_install[uefi-83nightly]
2-
tests/install/test.py::TestNested::test_tune_firstboot[None-uefi-83nightly-host1]
3-
tests/install/test.py::TestNested::test_boot_inst[uefi-83nightly-host1]
1+
tests/install/test.py::TestNested::test_install[uefi-83nightly-ext]
2+
tests/install/test.py::TestNested::test_tune_firstboot[None-uefi-83nightly-host1-ext]
3+
tests/install/test.py::TestNested::test_boot_inst[uefi-83nightly-host1-ext]

tests/install/test.py

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def helper_vm_with_plugged_disk(running_vm, create_vms):
4040

4141
@pytest.mark.dependency()
4242
class TestNested:
43+
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
4344
@pytest.mark.parametrize("iso_version", (
4445
"83nightly",
4546
"83rc1", "83b2", "83b1",
@@ -74,16 +75,21 @@ class TestNested:
7475
vifs=[dict(index=0, network_name=NETWORKS["MGMT"])],
7576
))
7677
@pytest.mark.answerfile(
77-
lambda install_disk: AnswerFile("INSTALL").top_append(
78+
lambda install_disk, local_sr: AnswerFile("INSTALL")
79+
.top_setattr({} if local_sr == "nosr" else {"sr-type": local_sr})
80+
.top_append(
7881
{"TAG": "source", "type": "local"},
79-
{"TAG": "primary-disk", "CONTENTS": install_disk},
82+
{"TAG": "primary-disk",
83+
"guest-storage": "no" if local_sr == "nosr" else "yes",
84+
"CONTENTS": install_disk},
8085
))
8186
def test_install(self, vm_booted_with_installer, install_disk,
82-
firmware, iso_version):
87+
firmware, iso_version, local_sr):
8388
host_vm = vm_booted_with_installer
8489
installer.monitor_install(ip=host_vm.ip)
8590

8691
@pytest.mark.usefixtures("xcpng_chained")
92+
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
8793
@pytest.mark.parametrize("machine", ("host1", "host2"))
8894
@pytest.mark.parametrize("version", (
8995
"83nightly",
@@ -96,12 +102,12 @@ def test_install(self, vm_booted_with_installer, install_disk,
96102
))
97103
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
98104
@pytest.mark.continuation_of(
99-
lambda version, firmware: [dict(
105+
lambda version, firmware, local_sr: [dict(
100106
vm="vm1",
101-
image_test=f"TestNested::test_install[{firmware}-{version}]")])
107+
image_test=f"TestNested::test_install[{firmware}-{version}-{local_sr}]")])
102108
@pytest.mark.small_vm
103109
def test_tune_firstboot(self, create_vms, helper_vm_with_plugged_disk,
104-
firmware, version, machine):
110+
firmware, version, machine, local_sr):
105111
helper_vm = helper_vm_with_plugged_disk
106112

107113
helper_vm.ssh(["mount /dev/xvdb1 /mnt"])
@@ -271,6 +277,7 @@ def _test_firstboot(self, create_vms, mode, *, machine='DEFAULT', is_restore=Fal
271277
raise
272278

273279
@pytest.mark.usefixtures("xcpng_chained")
280+
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
274281
@pytest.mark.parametrize("machine", ("host1", "host2"))
275282
@pytest.mark.parametrize("version", (
276283
"83nightly",
@@ -283,14 +290,15 @@ def _test_firstboot(self, create_vms, mode, *, machine='DEFAULT', is_restore=Fal
283290
))
284291
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
285292
@pytest.mark.continuation_of(
286-
lambda firmware, version, machine: [
293+
lambda firmware, version, machine, local_sr: [
287294
dict(vm="vm1",
288-
image_test=f"TestNested::test_tune_firstboot[None-{firmware}-{version}-{machine}]")])
295+
image_test=f"TestNested::test_tune_firstboot[None-{firmware}-{version}-{machine}-{local_sr}]")])
289296
def test_boot_inst(self, create_vms,
290-
firmware, version, machine):
297+
firmware, version, machine, local_sr):
291298
self._test_firstboot(create_vms, version, machine=machine)
292299

293300
@pytest.mark.usefixtures("xcpng_chained")
301+
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
294302
@pytest.mark.parametrize("machine", ("host1", "host2"))
295303
@pytest.mark.parametrize("mode", (
296304
"83nightly-83nightly",
@@ -306,14 +314,15 @@ def test_boot_inst(self, create_vms,
306314
))
307315
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
308316
@pytest.mark.continuation_of(
309-
lambda firmware, mode, machine: [dict(
317+
lambda firmware, mode, machine, local_sr: [dict(
310318
vm="vm1",
311-
image_test=(f"TestNested::test_upgrade[{firmware}-{mode}-{machine}]"))])
319+
image_test=(f"TestNested::test_upgrade[{firmware}-{mode}-{machine}-{local_sr}]"))])
312320
def test_boot_upg(self, create_vms,
313-
firmware, mode, machine):
321+
firmware, mode, machine, local_sr):
314322
self._test_firstboot(create_vms, mode, machine=machine)
315323

316324
@pytest.mark.usefixtures("xcpng_chained")
325+
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
317326
@pytest.mark.parametrize("mode", (
318327
"83nightly-83nightly-83nightly",
319328
"83rc1-83nightly-83nightly",
@@ -328,14 +337,15 @@ def test_boot_upg(self, create_vms,
328337
))
329338
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
330339
@pytest.mark.continuation_of(
331-
lambda firmware, mode: [dict(
340+
lambda firmware, mode, local_sr: [dict(
332341
vm="vm1",
333-
image_test=(f"TestNested::test_restore[{firmware}-{mode}]"))])
342+
image_test=(f"TestNested::test_restore[{firmware}-{mode}-{local_sr}]"))])
334343
def test_boot_rst(self, create_vms,
335-
firmware, mode):
344+
firmware, mode, local_sr):
336345
self._test_firstboot(create_vms, mode, is_restore=True)
337346

338347
@pytest.mark.usefixtures("xcpng_chained")
348+
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
339349
@pytest.mark.parametrize("machine", ("host1", "host2"))
340350
@pytest.mark.parametrize(("orig_version", "iso_version"), [
341351
("83nightly", "83nightly"),
@@ -351,21 +361,22 @@ def test_boot_rst(self, create_vms,
351361
])
352362
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
353363
@pytest.mark.continuation_of(
354-
lambda firmware, orig_version, machine: [dict(
364+
lambda firmware, orig_version, machine, local_sr: [dict(
355365
vm="vm1",
356-
image_test=f"TestNested::test_boot_inst[{firmware}-{orig_version}-{machine}]")])
366+
image_test=f"TestNested::test_boot_inst[{firmware}-{orig_version}-{machine}-{local_sr}]")])
357367
@pytest.mark.answerfile(
358368
lambda install_disk: AnswerFile("UPGRADE").top_append(
359369
{"TAG": "source", "type": "local"},
360370
{"TAG": "existing-installation",
361371
"CONTENTS": install_disk},
362372
))
363373
def test_upgrade(self, vm_booted_with_installer, install_disk,
364-
firmware, orig_version, iso_version, machine):
374+
firmware, orig_version, iso_version, machine, local_sr):
365375
host_vm = vm_booted_with_installer
366376
installer.monitor_upgrade(ip=host_vm.ip)
367377

368378
@pytest.mark.usefixtures("xcpng_chained")
379+
@pytest.mark.parametrize("local_sr", ("nosr", "ext", "lvm"))
369380
@pytest.mark.parametrize(("orig_version", "iso_version"), [
370381
("83nightly-83nightly", "83nightly"),
371382
("83rc1-83nightly", "83nightly"),
@@ -380,15 +391,15 @@ def test_upgrade(self, vm_booted_with_installer, install_disk,
380391
])
381392
@pytest.mark.parametrize("firmware", ("uefi", "bios"))
382393
@pytest.mark.continuation_of(
383-
lambda firmware, orig_version: [dict(
394+
lambda firmware, orig_version, local_sr: [dict(
384395
vm="vm1",
385-
image_test=f"TestNested::test_boot_upg[{firmware}-{orig_version}-host1]")])
396+
image_test=f"TestNested::test_boot_upg[{firmware}-{orig_version}-host1-{local_sr}]")])
386397
@pytest.mark.answerfile(
387398
lambda install_disk: AnswerFile("RESTORE").top_append(
388399
{"TAG": "backup-disk",
389400
"CONTENTS": install_disk},
390401
))
391402
def test_restore(self, vm_booted_with_installer, install_disk,
392-
firmware, orig_version, iso_version):
403+
firmware, orig_version, iso_version, local_sr):
393404
host_vm = vm_booted_with_installer
394405
installer.monitor_restore(ip=host_vm.ip)

0 commit comments

Comments
 (0)