Skip to content

Commit ef583b4

Browse files
committed
blocked
1 parent 8bebbd7 commit ef583b4

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

irods/test/scripts/test012_pam_interactive_multistep.bats

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ SKIP_IINIT_FOR_PASSWORD=yes
88
. $BATS_TEST_DIRNAME/test_support_functions
99

1010
export TESTUSER=alice
11+
export FIRST_PASSWORD=somerods
1112
export SECOND_PASSWORD=otherrods
1213

1314
setup() {
@@ -19,8 +20,8 @@ setup() {
1920
user rods \
2021
password rods \
2122

22-
apt update
23-
apt install -y db-util libpam0g-dev
23+
sudo apt update
24+
sudo apt install -y db-util libpam0g-dev
2425

2526
## Because iRODS 5+ negotiates for SSL automatically:
2627
CLIENT_JSON=~/.irods/irods_environment.json
@@ -31,7 +32,7 @@ setup() {
3132

3233
setup_pam_login_for_user "${FIRST_PASSWORD}" $TESTUSER
3334
sudo cp $BATS_TEST_DIRNAME/files_for_test012/pam_interactive /etc/pam.d/irods
34-
sudo mkdir /t012 && gcc -o /t012/pam_clear_token.so -fno-stack-protector -shared -fPIC $BATS_TEST_DIRNAME/files_for_test012/pam_clear_token.c
35+
sudo mkdir /t012 && sudo gcc -o /t012/pam_clear_token.so -fno-stack-protector -shared -fPIC $BATS_TEST_DIRNAME/files_for_test012/pam_clear_token.c
3536

3637
db_file=/t012/pam_userdb.db
3738
sudo db_load -T -t hash "$db_file" <<<"${TESTUSER}"$'\n'"${SECOND_PASSWORD}"
@@ -49,7 +50,7 @@ setup() {
4950
}
5051

5152
@test "pam_interactive_test_multistep_with_correct_passwords" {
52-
53+
:
5354
python -c"
5455
import getpass
5556
import irods
@@ -58,11 +59,15 @@ from unittest.mock import patch
5859
5960
def getpass_new_callable(answers=()):
6061
class iterate_answers:
61-
def __init__(self,answers = answers ): self.answers = answers; self.count = 0
62-
def __call__(self):
63-
count = self.count
64-
self.count += 1
65-
return self.answers[count]
62+
def __init__(self,answers = answers):
63+
self.answers = answers
64+
self.count = 0
65+
def __call__(self,*_):
66+
count = self.count
67+
self.count += 1
68+
ans = self.answers[count]
69+
print ('*** giving answer:', ans)
70+
return ans
6671
return lambda : iterate_answers()
6772
6873
home = None
@@ -71,7 +76,7 @@ with patch(
7176
'getpass.getpass',
7277
new_callable=getpass_new_callable(answers=[os.environ['FIRST_PASSWORD'],os.environ['SECOND_PASSWORD']])
7378
):
74-
sess = make_session(test_server_version=False)
79+
sess = irods.helpers.make_session(test_server_version=False)
7580
home = sess.collections.get(f'/{sess.zone}/home/{sess.username}')
7681
7782
if home is None:

0 commit comments

Comments
 (0)