Skip to content

Commit 4f3f20d

Browse files
committed
review suggestions mon 10/7 - final review imminent
1 parent 7d58ac8 commit 4f3f20d

3 files changed

Lines changed: 18 additions & 20 deletions

File tree

irods/test/scripts/test002.bats

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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
47
PYTHON=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"
1114
NEW_PAM_PASSWD="new_pass"
1215

1316
setup()
1417
{
15-
setup_pam_login_for_alice $PASSWD
18+
setup_pam_login_for_alice "$OLD_PAM_PASSWD"
1619
}
1720

1821
teardown()
@@ -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

irods/test/scripts/test003.bats

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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
47
PYTHON=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
}

irods/test/scripts/test012.bats

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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
47
PYTHON=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
}

0 commit comments

Comments
 (0)