Skip to content

Commit 4eace97

Browse files
committed
testhelper: add directmnt and get_share()
Add an additional entity directmnt which points to the mount to the underlying filesystem. Also add get_share() to get the share entity. Signed-off-by: Sachin Prabhu <[email protected]>
1 parent f271713 commit 4eace97

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

testhelper/testhelper.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,21 @@ def get_shares(test_info: dict) -> typing.List[dict]:
9393
default_fs = test_info.get("test_backend", None)
9494
arr = []
9595
for sharename in test_info.get("exported_sharenames", []):
96-
arr.append({"name": sharename, "mntdir": None, "fs": default_fs})
96+
arr.append(
97+
{
98+
"name": sharename,
99+
"mntdir": None,
100+
"fs": default_fs,
101+
"directmnt": None,
102+
}
103+
)
97104
for share in test_info.get("exported_shares", []):
98105
arr.append(
99106
{
100107
"name": share.get("name", None),
101108
"mntdir": share.get("mntdir", None),
102109
"fs": share.get("fs", default_fs),
110+
"directmnt": share.get("directmnt", None),
103111
}
104112
)
105113
test_info["shares"] = arr
@@ -121,6 +129,21 @@ def get_share(test_info: dict, sharename: str) -> dict:
121129
return share
122130
return {}
123131

132+
def get_shares_with_directmnt(test_info: dict) -> typing.List[dict]:
133+
"""
134+
Get list of shares with directmnt enabled
135+
136+
Parameters:
137+
test_info: Dict containing the parsed yaml file.
138+
Returns:
139+
list of shares
140+
"""
141+
arr = []
142+
for share in get_shares(test_info):
143+
if share["directmnt"] is not None:
144+
arr.append(share)
145+
return arr
146+
124147

125148
def is_premounted_share(share: dict) -> bool:
126149
"""

0 commit comments

Comments
 (0)