Skip to content

Commit da6c5d5

Browse files
tests/storage/largeblock: Updated largeblock to handle both vhd and qcow2 vdi image format
Signed-off-by: Rushikesh Jadhav <[email protected]>
1 parent 872c4f8 commit da6c5d5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/storage/largeblock/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
from lib.sr import SR
1212

1313
@pytest.fixture(scope='package')
14-
def largeblock_sr(host: Host, unused_4k_disks: dict[Host, list[Host.BlockDeviceInfo]]) -> Generator[SR]:
14+
def largeblock_sr(host: Host, unused_4k_disks: dict[Host, list[Host.BlockDeviceInfo]], image_format) -> Generator[SR]:
1515
""" A LARGEBLOCK SR on first host. """
1616
sr_disk = unused_4k_disks[host][0]["name"]
17-
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test", {'device': '/dev/' + sr_disk})
17+
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test",
18+
{'device': '/dev/' + sr_disk,
19+
'preferred-image-formats': image_format})
1820
yield sr
1921
# teardown
2022
sr.destroy()

tests/storage/largeblock/test_largeblock_sr.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ class TestLARGEBLOCKSRCreateDestroy:
2323
def test_create_sr_with_missing_device(self, host):
2424
try_to_create_sr_with_missing_device('largeblock', 'LARGEBLOCK-local-SR-test', host)
2525

26-
def test_create_and_destroy_sr(self, host: Host, unused_4k_disks: dict[Host, list[Host.BlockDeviceInfo]]) -> None:
26+
def test_create_and_destroy_sr(self, host: Host,
27+
unused_4k_disks: dict[Host, list[Host.BlockDeviceInfo]],
28+
image_format) -> None:
2729
# Create and destroy tested in the same test to leave the host as unchanged as possible
2830
sr_disk = unused_4k_disks[host][0]["name"]
29-
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test", {'device': '/dev/' + sr_disk}, verify=True)
31+
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test",
32+
{'device': '/dev/' + sr_disk,
33+
'preferred-image-formats': image_format}, verify=True)
3034
# import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in
3135
# the next tests, because errors in fixtures break teardown
3236
vm = host.import_vm(vm_image('mini-linux-x86_64-bios'), sr_uuid=sr.uuid)

0 commit comments

Comments
 (0)