Skip to content

Commit 4470fd7

Browse files
committed
TLS initializes correctly but Bats tests still fail
1 parent abe2232 commit 4470fd7

File tree

3 files changed

+50
-5
lines changed

3 files changed

+50
-5
lines changed

irods/test/harness/manage_irods5_procs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
1+
if [ `id -un` = irods ]; then
2+
LAUNCH='bash -c'
3+
else
4+
LAUNCH='sudo su - irods -c'
5+
fi
6+
7+
start() {
8+
$LAUNCH 'irodsServer -d -p /tmp/irods.pid'
9+
}
10+
11+
stop() {
12+
$LAUNCH 'kill -QUIT $(cat /tmp/irods.pid) && rm -f /tmp/irods.pid'
13+
}
14+
115
if [ "$1" = "start" ]; then
2-
sudo su - irods -c 'irodsServer -d -p /tmp/irods.pid'
16+
start
317
elif [ "$1" = "start-bg" ]; then
4-
sudo su - irods -c 'irodsServer --stdout -p /tmp/irods.pid >/tmp/irods.log &'
18+
$LAUNCH 'irodsServer --stdout -p /tmp/irods.pid >/tmp/irods.log &'
19+
elif [ "$1" = "rescan-config" ]; then
20+
$LAUNCH 'pkill -HUP irodsServer'
521
elif [ "$1" = "status" ]; then
622
pgrep -afl "irods(Delay|Agent|Server)"
723
elif [ "$1" = "stop" ]; then
8-
sudo su - irods -c 'kill -QUIT $(cat /tmp/irods.pid) && rm -f /tmp/irods.pid'
24+
stop
25+
elif [ "$1" = "restart" ]; then
26+
stop && start
927
elif [ "$1" = "wait" ]; then
10-
sudo su - irods -c '
28+
$LAUNCH '
1129
pid=`cat /tmp/irods.pid 2>/dev/null`;
1230
[ -n "$pid" ] && { while ps -eo pid |grep $pid >/dev/null 2>&1; do sleep 1; done; }'
1331
else

irods/test/login_auth_test.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
. $(dirname $0)/scripts/test_support_functions
33
. $(dirname $0)/scripts/update_json_for_test
44

5+
IRODS_SERVER_CONFIG=/etc/irods/server_config.json
56
IRODS_SERVICE_ACCOUNT_ENV_FILE=~irods/.irods/irods_environment.json
67
LOCAL_ACCOUNT_ENV_FILE=~/.irods/irods_environment.json
78

@@ -10,7 +11,7 @@ setup_preconnect_preference DONT_CARE
1011
add_irods_to_system_pam_configuration
1112

1213
# set up /etc/irods/ssl directory and files
13-
set_up_ssl sudo -q
14+
set_up_ssl sudo
1415

1516
sudo useradd -ms/bin/bash alissa
1617
sudo chpasswd <<<"alissa:test123"
@@ -23,6 +24,18 @@ activate_virtual_env_with_prc_installed >/dev/null 2>&1 || { echo >&2 "couldn't
2324

2425
# Set up testuser with rods+SSL so we never have to run login_auth_tests.py as the service account.
2526
iinit_as_rods >/dev/null 2>&1 || { echo >&2 "couldn't iinit as rods"; exit 2; }
27+
28+
# Configure clients with admin user but no TLS yet because that requires a rebounce (or rescan-config) in >= iRODS 5.0
29+
30+
if irods_server_version ge 5.0.0; then
31+
update_json_file $IRODS_SERVER_CONFIG \
32+
"$(newcontent $IRODS_SERVER_CONFIG tls_server_items tls_client_items)"
33+
#sudo su - irods -c "/manage_irods5_procs restart"
34+
sudo su - irods -c "/manage_irods5_procs rescan-config"
35+
fi
36+
37+
# Configure clients with admin user + TLS
38+
2639
update_json_file $LOCAL_ACCOUNT_ENV_FILE \
2740
"$(newcontent $LOCAL_ACCOUNT_ENV_FILE ssl_keys encrypt_keys)"
2841

irods/test/scripts/update_json_for_test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
#!/bin/bash
2+
3+
declare -A tls_server_items=(
4+
[tls_server]='{"certificate_chain_file":"/etc/irods/ssl/irods.crt",
5+
"certificate_key_file":"/etc/irods/ssl/irods.key",
6+
"dh_params_file":"/etc/irods/ssl/dhparams.pem"}'
7+
)
8+
9+
declare -A tls_client_items=(
10+
[tls_client]='{"ca_certificate_file":"/etc/irods/ssl/irods.crt",
11+
"ca_certificate_path":"/etc/ssl/certs",
12+
"verify_server":"cert"}'
13+
)
14+
215
declare -A ssl_keys=(
316
[irods_client_server_negotiation]='"request_server_negotiation"'
417
[irods_client_server_policy]='"CS_NEG_REQUIRE"'
@@ -12,6 +25,7 @@ declare -A ssl_keys=(
1225
declare -A pam_keys=(
1326
[irods_authentication_scheme]="\"$(pam_auth_string)\""
1427
)
28+
1529
declare -A encrypt_keys=(
1630
[irods_encryption_key_size]=16
1731
[irods_encryption_salt_size]=8

0 commit comments

Comments
 (0)