Skip to content

Commit 3832ff0

Browse files
committed
add irods_server_version to test_support_functions
1 parent 4421f80 commit 3832ff0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

irods/test/scripts/test_support_functions

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,19 @@ mtime_and_content()
205205
stat -c%y "$1"
206206
cat "$1"
207207
}
208+
209+
irods_server_version() {
210+
python -c "import irods.helpers as h
211+
import operator,sys
212+
if len(sys.argv) == 1:
213+
(comparison,relto)=('','')
214+
elif len(sys.argv) == 3:
215+
(comparison,relto)=sys.argv[1:3]
216+
fm_tuple = lambda tup: '.'.join(str(_) for _ in tup)
217+
to_tuple = lambda vstr: tuple(int(_) for _ in vstr.split('.'))
218+
svt = h.make_session().server_version_without_auth()
219+
if relto:
220+
exit(0 if vars(operator)[comparison](svt,to_tuple(relto)) else 1)
221+
print(fm_tuple(svt))
222+
" $1 $2
223+
}

0 commit comments

Comments
 (0)