Skip to content

Commit 6a07083

Browse files
committed
force pw prompt
1 parent 8bc5228 commit 6a07083

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

irods/test/scripts/test012_pam_interactive_multistep.bats

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# The tests in this BATS module must be run as a (passwordless) sudo-enabled user.
44
# It is also required that the python irodsclient be installed under irods' ~/.local environment.
55

6-
#SKIP_IINIT_FOR_PASSWORD=yes
6+
SKIP_IINIT_FOR_PASSWORD=yes
77

88
. $BATS_TEST_DIRNAME/test_support_functions
99

@@ -30,9 +30,9 @@ setup() {
3030

3131
sudo apt install irods-auth-plugin-pam-interactive-{client,server}
3232

33-
export IINIT_TTL=100
3433
setup_pam_login_for_user "${FIRST_PASSWORD}" $TESTUSER
35-
sudo cp $BATS_TEST_DIRNAME/files_for_test012/pam_interactive /etc/pam.d/irods
34+
sudo cp $BATS_TEST_DIRNAME/files_for_test012/pam_password /etc/pam.d/irods
35+
sudo cp $BATS_TEST_DIRNAME/files_for_test012/pam_interactive /etc/pam.d/
3636
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
3737

3838
db_file=/t012/pam_userdb.db
@@ -57,6 +57,7 @@ import getpass
5757
import irods
5858
import os
5959
from unittest.mock import patch
60+
from irods.auth import FORCE_PASSWORD_PROMPT
6061
6162
def getpass_new_callable(answers=()):
6263
class iterate_answers:
@@ -78,6 +79,7 @@ with patch(
7879
new_callable=getpass_new_callable(answers=[os.environ['FIRST_PASSWORD'],os.environ['SECOND_PASSWORD']])
7980
):
8081
sess = irods.helpers.make_session(test_server_version=False)
82+
sess.set_auth_option_for_scheme('pam_interactive', FORCE_PASSWORD_PROMPT, True)
8183
home = sess.collections.get(f'/{sess.zone}/home/{sess.username}')
8284
8385
if home is None:

0 commit comments

Comments
 (0)