Skip to content

Commit bb9b344

Browse files
committed
add irods_server_version to test_support_functions
1 parent 5912699 commit bb9b344

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

irods/test/scripts/test_support_functions

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
irods_server_version() {
2+
python -c "import irods.helpers as h
3+
import operator,sys
4+
if len(sys.argv) == 1:
5+
(comparison,relto)=('','')
6+
elif len(sys.argv) == 3:
7+
(comparison,relto)=sys.argv[1:3]
8+
fm_tuple = lambda tup: '.'.join(str(_) for _ in tup)
9+
to_tuple = lambda vstr: tuple(int(_) for _ in vstr.split('.'))
10+
svt = h.make_session().server_version_without_auth()
11+
if relto:
12+
exit(0 if vars(operator)[comparison](svt,to_tuple(relto)) else 1)
13+
print(fm_tuple(svt))
14+
" $1 $2
15+
}
16+
117
SCRIPTDIR=${BASH_SOURCE[0]}
218
up_from_script_dir() {
319
local x incr=""

0 commit comments

Comments
 (0)