Skip to content

Commit 1e4031c

Browse files
committed
Use unused_disks in lvm tests
Signed-off-by: Yann Dirson <[email protected]>
1 parent 22ccd0e commit 1e4031c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/storage/lvm/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
import pytest
33

44
@pytest.fixture(scope='package')
5-
def lvm_sr(host, sr_disk):
5+
def lvm_sr(host, unused_disks):
66
""" An LVM SR on first host. """
7+
sr_disk = unused_disks[host][0]
78
sr = host.sr_create('lvm', "LVM-local-SR-test", {'device': '/dev/' + sr_disk})
89
yield sr
910
# teardown

tests/storage/lvm/test_lvm_sr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class TestLVMSRCreateDestroy:
1515
def test_create_sr_with_missing_device(self, host):
1616
try_to_create_sr_with_missing_device('lvm', 'LVM-local-SR-test', host)
1717

18-
def test_create_and_destroy_sr(self, host, sr_disk):
18+
def test_create_and_destroy_sr(self, host, unused_disks):
19+
sr_disk = unused_disks[host][0]
1920
# Create and destroy tested in the same test to leave the host as unchanged as possible
2021
sr = host.sr_create('lvm', "LVM-local-SR-test", {'device': '/dev/' + sr_disk}, verify=True)
2122
# import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in

0 commit comments

Comments
 (0)