Skip to content

Commit 1f201d8

Browse files
committed
WIP glusterfs: switch from sr_disk_for_all_hosts to pool_with_unused_disk
TODO: needs --disks on CLI to get feature parity first. Signed-off-by: Yann Dirson <[email protected]>
1 parent 9c4d791 commit 1f201d8

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/storage/glusterfs/conftest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ def pool_with_glusterfs(pool_without_glusterfs, pool_with_saved_yum_state):
7171
pool.exec_on_hosts_on_error_continue(_teardown_host_with_glusterfs)
7272

7373
@pytest.fixture(scope='package')
74-
def gluster_disk(host, sr_disk_for_all_hosts):
75-
sr_disk = sr_disk_for_all_hosts
74+
def gluster_disk(pool_with_unused_disk, unused_disks):
75+
pool = pool_with_unused_disk
7676
mountpoint = '/mnt/sr_disk'
77-
for h in host.pool.hosts:
77+
for h in pool.hosts:
78+
sr_disk = unused_disks[h][0]
7879
setup_formatted_and_mounted_disk(h, sr_disk, 'xfs', mountpoint)
7980
yield
80-
host.pool.exec_on_hosts_on_error_continue(
81+
pool.exec_on_hosts_on_error_continue(
8182
lambda h: teardown_formatted_and_mounted_disk(h, mountpoint)
8283
)
8384

tests/storage/glusterfs/test_glusterfs_sr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# - one XCP-ng host >= 8.2 with an additional unused disk for the SR
1010
# - access to XCP-ng RPM repository from the host
1111

12-
@pytest.mark.usefixtures("sr_disk_for_all_hosts") # don't even run the tests if there's no free disk
12+
@pytest.mark.usefixtures("pool_with_unused_disk") # don't even run the tests if there's no free disk
1313
class TestGlusterFSSRCreateDestroy:
1414
"""
1515
Tests that do not use fixtures that setup the SR or import VMs,

0 commit comments

Comments
 (0)