File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bats
2+ #
3+ # Test creation of .irodsA for iRODS native authentication using the free function,
4+ # irods.client_init.write_pam_credentials_to_secrets_file
25
36. " $BATS_TEST_DIRNAME " /test_support_functions
47PYTHON=python3
@@ -7,12 +10,12 @@ PYTHON=python3
710# Run as ubuntu user with sudo; python_irodsclient must be installed (in either ~/.local or a virtualenv)
811#
912
10- PASSWD= test123
13+ OLD_PAM_PASSWD= " test123"
1114NEW_PAM_PASSWD=" new_pass"
1215
1316setup ()
1417{
15- setup_pam_login_for_alice $PASSWD
18+ setup_pam_login_for_alice " $OLD_PAM_PASSWD "
1619}
1720
1821teardown ()
@@ -23,11 +26,11 @@ teardown()
2326
2427@test create_secrets_file {
2528
29+ # Old .irodsA is already created, so we delete it and alter the pam password.
2630 sudo chpasswd <<< " alice:$NEW_PAM_PASSWD"
2731 rm -f ~ /.irods/.irodsA
2832 $PYTHON -c " import irods.client_init; irods.client_init.write_pam_credentials_to_secrets_file('$NEW_PAM_PASSWD ')"
2933
30-
3134 # Define the core Python to be run, basically a minimal code block ensuring that we can authenticate to iRODS
3235 # without an exception being raised.
3336
Original file line number Diff line number Diff line change 11#! /usr/bin/env bats
2+ #
3+ # Test creation of .irodsA for iRODS pam_password authentication using the free function,
4+ # irods.client_init.write_native_credentials_to_secrets_file
25
36. " $BATS_TEST_DIRNAME " /test_support_functions
47PYTHON=python3
@@ -7,30 +10,19 @@ PYTHON=python3
710# Run as ubuntu user with sudo; python_irodsclient must be installed (in either ~/.local or a virtualenv)
811#
912
10- setup ()
11- {
12- :
13- }
14-
15- teardown ()
16- {
17- :
18- }
19-
2013@test create_irods_secrets_file {
2114
2215 rm -fr ~ /.irods
2316 mkdir ~ /.irods
2417 cat > ~ /.irods/irods_environment.json << -EOF
2518 { "irods_host":"$( hostname) ",
26- "irods_port":1247,
27- "irods_user_name":"rods",
28- "irods_zone_name":"tempZone"
29- }
19+ "irods_port":1247,
20+ "irods_user_name":"rods",
21+ "irods_zone_name":"tempZone"
22+ }
3023 EOF
3124 $PYTHON -c " import irods.client_init; irods.client_init.write_native_credentials_to_secrets_file('rods')"
3225
33-
3426 # Define the core Python to be run, basically a minimal code block ensuring that we can authenticate to iRODS
3527 # without an exception being raised.
3628
@@ -42,5 +34,5 @@ print ('env_auth_scheme=%s' % ses.pool.account._original_authentication_scheme)
4234"
4335 OUTPUT=$( $PYTHON -c " $SCRIPT " )
4436 # Assert passing value
45- [ $OUTPUT = env_auth_scheme= native ]
37+ [ $OUTPUT = " env_auth_scheme=native" ]
4638}
Original file line number Diff line number Diff line change 11#! /usr/bin/env bats
2+ #
3+ # Test creation of .irodsA for iRODS pam_password authentication, this time purely internal to the PRC
4+ # library code.
25
36. " $BATS_TEST_DIRNAME " /test_support_functions
47PYTHON=python3
@@ -64,5 +67,5 @@ $SCRIPT")
6467 [ " $SECRETS_0 " = " $SECRETS_1 " ]
6568
6669 # Test assertion: authentication method is pam_password
67- [[ $OUTPUT = * = pam_password ] ]
70+ [ $OUTPUT = " env_auth_scheme =pam_password" ]
6871}
You can’t perform that action at this time.
0 commit comments