Skip to content

Commit 5275f26

Browse files
committed
sr_disk: document non-obvious behavior of features to be reworked
Quite important to make sure we replace them properly (ie. either with identical behavior, or with a more correct one when applicable). Signed-off-by: Yann Dirson <[email protected]>
1 parent c08f636 commit 5275f26

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

conftest.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,12 @@ def local_sr_on_hostB1(hostB1):
328328

329329
@pytest.fixture(scope='session')
330330
def sr_disk(pytestconfig, host):
331+
"""
332+
Disk DEVICE NAME available on FIRST POOL MASTER.
333+
334+
Abort if not exactly one --sr_disk. If --sr_disk=auto take any, else
335+
return requested device (abort if not present).
336+
"""
331337
disks = pytestconfig.getoption("sr_disk")
332338
if len(disks) != 1:
333339
pytest.fail("This test requires exactly one --sr-disk parameter")
@@ -346,6 +352,12 @@ def sr_disk(pytestconfig, host):
346352

347353
@pytest.fixture(scope='session')
348354
def sr_disk_4k(pytestconfig, host):
355+
"""
356+
Disk DEVICE NAME with 4KB blocksize available on FIRST POOL MASTER.
357+
358+
Abort if not exactly one --sr_disk. If --sr_disk=auto take any, else
359+
return requested device (abort if not present).
360+
"""
349361
disks = pytestconfig.getoption("sr_disk_4k")
350362
if len(disks) != 1:
351363
pytest.fail("This test requires exactly one --sr-disks-4k parameter")
@@ -364,6 +376,12 @@ def sr_disk_4k(pytestconfig, host):
364376

365377
@pytest.fixture(scope='session')
366378
def sr_disk_for_all_hosts(pytestconfig, request, host):
379+
"""
380+
Disk DEVICE NAME available on all hosts of FIRST POOL.
381+
382+
Abort if not exactly one --sr_disk. If --sr_disk=auto take any, else
383+
return requested device (abort if not present).
384+
"""
367385
disks = pytestconfig.getoption("sr_disk")
368386
if len(disks) != 1:
369387
pytest.fail("This test requires exactly one --sr-disk parameter")
@@ -393,6 +411,14 @@ def sr_disk_for_all_hosts(pytestconfig, request, host):
393411

394412
@pytest.fixture(scope='session')
395413
def sr_disks_for_all_hosts(pytestconfig, request, host):
414+
"""
415+
List of disk DEVICE NAMES available on all hosts of FIRST POOL.
416+
417+
Abort if no --sr_disk. If one --sr_disk=auto given, return names of all
418+
"available" disk device occuring on all hosts in the pool and
419+
IGNORE ALL OTHER --sr_disk; else return all devices on commandline (abort
420+
if any is not present or not "available").
421+
"""
396422
disks = pytestconfig.getoption("sr_disk")
397423
assert len(disks) > 0, "This test requires at least one --sr-disk parameter"
398424
# Fetch available disks on the master host

tests/storage/linstor/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313

1414
@pytest.fixture(scope='package')
1515
def lvm_disks(host, sr_disks_for_all_hosts, provisioning_type):
16+
"""
17+
Common LVM PVs on which a LV is created on each host of the pool.
18+
19+
On each host in the pool, create PV on each of those disks whose
20+
DEVICE NAME exists ACROSS THE WHOLE POOL. Then make a VG out of
21+
all those, then a LV taking up the whole VG space.
22+
23+
Return the list of device node paths for that list of devices
24+
used in all hosts.
25+
"""
1626
devices = [f"/dev/{disk}" for disk in sr_disks_for_all_hosts]
1727
hosts = host.pool.hosts
1828

0 commit comments

Comments
 (0)