Skip to content

Commit

Permalink
fix: fix users used in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Feb 28, 2025
1 parent 78fc3da commit 9e062ca
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
10 changes: 5 additions & 5 deletions tests/Integration/Framework/Test_Proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,25 @@ fi
echo

echo "====================================================="
echo "=== dirac-admin-get-proxy adminusername prod -v 4:00"
echo "=== dirac-admin-get-proxy ciuser prod -v 4:00"
echo
dirac-admin-get-proxy adminusername prod -v 4:00
dirac-admin-get-proxy ciuser prod -v 4:00
if [[ "${?}" -ne 0 ]]; then
exit 1
fi
echo

echo "================================================================================="
echo "=== dirac-admin-get-proxy adminusername no_exist -v 4:00 (now this will fail...)"
echo "=== dirac-admin-get-proxy ciuser no_exist -v 4:00 (now this will fail...)"
echo
dirac-admin-get-proxy adminusername no_exist -v 4:00
dirac-admin-get-proxy ciuser no_exist -v 4:00
if [[ "${?}" -eq 0 ]]; then
exit 1
fi
echo

# Find proxy file
PROXYFILE=`pwd`/proxy.adminusername.prod
PROXYFILE=`pwd`/proxy.ciuser.prod

echo "================================"
echo "=== dirac-proxy-info $PROXYFILE"
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/all_integration_server_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fi

echo -e "*** $(date -u) Run it with the admin privileges" |& tee -a "${SERVER_TEST_OUTPUT}"
echo -e "*** $(date -u) getting the prod role again\n" |& tee -a "${SERVER_TEST_OUTPUT}"
# dirac-proxy-init -g prod "${DEBUG}" |& tee -a "${SERVER_TEST_OUTPUT}"
dirac-proxy-init -g prod "${DEBUG}" |& tee -a "${SERVER_TEST_OUTPUT}"
# python "${THIS_DIR}/DataManagementSystem/Test_Client_DFC.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))
diracDFCDB |& tee -a "${SERVER_TEST_OUTPUT}"
python "${THIS_DIR}/DataManagementSystem/Test_FileCatalogDB.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))
Expand Down
2 changes: 0 additions & 2 deletions tests/Jenkins/dirac-cfg-setup-diracx.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def main(url: str, disabled_vos: list[str]):
"UserSubjects": {
"adminusername": "e2cb28ec-1a1e-40ee-a56d-d899b79879ce",
"ciuser": "26dbe36e-cf5c-4c52-a834-29a1c904ef74",
"trialUser": "a95ab678-3fa4-41b9-b863-fe62ce8064ce",
},
"Support": {
"Message": "Contact the help desk",
Expand All @@ -61,7 +60,6 @@ def main(url: str, disabled_vos: list[str]):
"UserSubjects": {
"adminusername": "26b14fc9-6d40-4ca5-b014-6234eaf0fb6e",
"ciuser": "d3adc733-6588-4d6f-8581-5986b02d0c87",
"trialUser": "ff2152ff-34f4-4739-b106-3def37e291e3",
},
},
}
Expand Down
3 changes: 3 additions & 0 deletions tests/Jenkins/dirac_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ fullInstallDIRAC() {
dirac-rss-set-status --element Site --name DIRAC.Jenkins.ch --status Active --reason "Why not?" --tokenOwner DIRAC -o /DIRAC/Security/UseServerCertificate=True
dirac-admin-allow-se SE-1 SE-2 S3-DIRECT S3-INDIRECT --All --tokenOwner DIRAC -o /DIRAC/Security/UseServerCertificate=True

echo 'Generate adminusername proxy, to be used by few agents'
dirac-proxy-init -g prod -C /ca/certs/adminusername.pem -K /ca/certs/adminusername.key ${DEBUG}

#agents
findAgents
if ! diracAgents; then
Expand Down
4 changes: 2 additions & 2 deletions tests/Jenkins/install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ LocalInstallation
#LogLevel of the installed components
LogLevel = DEBUG

AdminUserName = ciuser
AdminUserName = adminusername
# DN of the Admin user certificate (default: None )
# In order the find out the DN that needs to be included in the Configuration for a given
# host or user certificate the following command can be used::
#
# openssl x509 -noout -subject -enddate -in <certfile.pem>
#
AdminUserDN = /C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser
AdminUserDN = /C=ch/O=DIRAC/OU=DIRAC CI/CN=adminusername
AdminUserEmail = [email protected]
AdminGroupName = dirac_admin
# DN of the host certificate (*) (default: None )
Expand Down
11 changes: 3 additions & 8 deletions tests/Jenkins/utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,7 @@ diracUserAndGroup() {
exit 1
fi

if ! dirac-admin-add-user -N trialUser -D /C=ch/O=DIRAC/OU=DIRAC\ CI/CN=trialUser -M [email protected] -G dirac_user -o /DIRAC/Security/UseServerCertificate=True "${DEBUG}"; then
echo 'ERROR: dirac-admin-add-user failed' >&2
exit 1
fi

if ! dirac-admin-add-group -G prod -U adminusername,ciuser,trialUser -P Operator,FullDelegation,ProxyManagement,ServiceAdministrator,JobAdministrator,CSAdministrator,FileCatalogManagement,SiteManager,NormalUser,ProductionManagement VO=vo -o /DIRAC/Security/UseServerCertificate=True "${DEBUG}"; then
if ! dirac-admin-add-group -G prod -U adminusername,ciuser -P Operator,FullDelegation,ProxyManagement,ServiceAdministrator,JobAdministrator,CSAdministrator,FileCatalogManagement,SiteManager,NormalUser,ProductionManagement VO=vo -o /DIRAC/Security/UseServerCertificate=True "${DEBUG}"; then
echo 'ERROR: dirac-admin-add-group failed' >&2
exit 1
fi
Expand All @@ -371,12 +366,12 @@ diracUserAndGroup() {
exit 1
fi

if ! dirac-admin-add-group -G jenkins_fcadmin -U adminusername,ciuser,trialUser -P FileCatalogManagement,NormalUser -o /DIRAC/Security/UseServerCertificate=True VO=vo "${DEBUG}"; then
if ! dirac-admin-add-group -G jenkins_fcadmin -U adminusername,ciuser -P FileCatalogManagement,NormalUser -o /DIRAC/Security/UseServerCertificate=True VO=vo "${DEBUG}"; then
echo 'ERROR: dirac-admin-add-group failed' >&2
exit 1
fi

if ! dirac-admin-add-group -G jenkins_user -U adminusername,ciuser,trialUser -P NormalUser VO=vo -o /DIRAC/Security/UseServerCertificate=True "${DEBUG}"; then
if ! dirac-admin-add-group -G jenkins_user -U adminusername,ciuser -P NormalUser VO=vo -o /DIRAC/Security/UseServerCertificate=True "${DEBUG}"; then
echo 'ERROR: dirac-admin-add-group failed' >&2
exit 1
fi
Expand Down

0 comments on commit 9e062ca

Please sign in to comment.