forked from irods/python-irodsclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPRC_issue_362.bats
More file actions
45 lines (37 loc) · 1.3 KB
/
PRC_issue_362.bats
File metadata and controls
45 lines (37 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# The tests in this BATS module must be run as a (passwordless) sudo-enabled user.
# It is also required that the python irodsclient be installed under irods' ~/.local environment.
. $BATS_TEST_DIRNAME/scripts/test_support_functions
setup() {
iinit_as_rods
setup_pam_login_for_user "test123" alice
cat >~/test_get_home_coll.py <<-EOF
import irods.test.helpers as h
ses = h.make_session()
home_coll = h.home_collection(ses)
exit(0 if ses.collections.get(home_coll).path == home_coll
and ses.pool.account._original_authentication_scheme.lower() in ('pam','pam_password')
else 1)
EOF
}
teardown() {
iinit_as_rods
finalize_pam_login_for_user alice
}
prc_test()
{
local CHR="$1"
## Arrange for secrets file to be generated internally by the Python client
cat >~/.python_irodsclient <<-EOF
legacy_auth.pam.store_password_to_environment True
legacy_auth.pam.password_for_auto_renew 'my${CHR}pass'
legacy_auth.pam.time_to_live_in_hours 1
EOF
local USER="alice"
local PASSWORD="my${CHR}pass"
sudo chpasswd <<<"$USER:$PASSWORD"
env PYTHON_IRODSCLIENT_CONFIGURATION_PATH='' python ~/test_get_home_coll.py
}
@test "test_with_atsymbol" { prc_test "@"; }
@test "test_with_semicolon" { prc_test ";"; }
@test "test_with_equals" { prc_test "="; }
@test "test_with_ampersand" { prc_test "&"; }