Skip to content

Commit 17d9fb0

Browse files
committed
testhelper: add filesystem direct mounts and get_shares_with_directmnt
Add share["backend"]["path"] to indicate where direct access to the share is available. Add helper function get_shares_with_directmnt() to locate shares with direct access to the exported path available Signed-off-by: Sachin Prabhu <[email protected]>
1 parent 29602a4 commit 17d9fb0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test-info.yml.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ shares:
1717
backend:
1818
# If present backend filesystem
1919
name: cephfs.vfs
20+
# If present, provides direct access to share
21+
path: /mnt/backend/export1
2022
# If present, username to perform the tests with on this share
2123
users:
2224
test2: x

testhelper/testhelper.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,19 @@ def get_exported_shares(test_info: dict) -> typing.List[str]:
190190
if not is_premounted_share(share):
191191
arr.append(share["name"])
192192
return arr
193+
194+
195+
def get_shares_with_directmnt(test_info: dict) -> typing.List[str]:
196+
"""
197+
Get list of shares with directmnt enabled
198+
199+
Parameters:
200+
test_info: Dict containing the parsed yaml file.
201+
Returns:
202+
list of shares
203+
"""
204+
arr = []
205+
for share in get_shares(test_info).values():
206+
if share["backend"].get("path", False):
207+
arr.append(share["name"])
208+
return arr

0 commit comments

Comments
 (0)