Skip to content

Commit c421cc4

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 cfe0199 commit c421cc4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/storage/largeblock/conftest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
import pytest
33

44
@pytest.fixture(scope='package')
5-
def largeblock_sr(host, sr_disk_4k):
5+
def largeblock_sr(host, image_format, sr_disk_4k):
66
""" A LARGEBLOCK SR on first host. """
7-
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test", {'device': '/dev/' + sr_disk_4k})
7+
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test", {
8+
'device': '/dev/' + sr_disk_4k,
9+
'preferred-image-formats': image_format
10+
})
811
yield sr
912
# teardown
1013
sr.destroy()

tests/storage/largeblock/test_largeblock_sr.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ class TestLARGEBLOCKSRCreateDestroy:
1515
def test_create_sr_with_missing_device(self, host):
1616
try_to_create_sr_with_missing_device('largeblock', 'LARGEBLOCK-local-SR-test', host)
1717

18-
def test_create_and_destroy_sr(self, host, sr_disk_4k):
18+
def test_create_and_destroy_sr(self, host, image_format, sr_disk_4k):
1919
# Create and destroy tested in the same test to leave the host as unchanged as possible
20-
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test", {'device': '/dev/' + sr_disk_4k}, verify=True)
20+
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test", {
21+
'device': '/dev/' + sr_disk_4k,
22+
'preferred-image-formats': image_format
23+
}, verify=True)
2124
# import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in
2225
# the next tests, because errors in fixtures break teardown
2326
vm = host.import_vm(vm_image('mini-linux-x86_64-bios'), sr_uuid=sr.uuid)

0 commit comments

Comments
 (0)