Skip to content

Commit

Permalink
test: added pilot user and group
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Mar 4, 2025
1 parent 8b6713c commit 981445d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/Integration/Framework/Test_UserProfileClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_storeRetrieveDelete():

retVal = up.listAvailableVars()
assert retVal["OK"], retVal
assert retVal["Value"] == [["adminusername", currentGroup, "vo", key]]
assert retVal["Value"] == [["ciuser", currentGroup, "vo", key]]

retVal = up.getUserProfiles()
assert retVal["OK"], retVal
Expand Down
5 changes: 0 additions & 5 deletions tests/Integration/all_integration_client_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ pytest --no-check-dirac-environment "${THIS_DIR}/AccountingSystem/Test_DataStore
pytest --no-check-dirac-environment "${THIS_DIR}/AccountingSystem/Test_ReportsClient.py" |& tee -a clientTestOutputs.txt; (( ERR |= "${?}" ))


#-------------------------------------------------------------------------------#
echo -e "*** $(date -u) **** FTS TESTS ****\n"
pytest --no-check-dirac-environment "${THIS_DIR}/DataManagementSystem/Test_Client_FTS3.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))


#-------------------------------------------------------------------------------#
echo -e "*** $(date -u) **** RMS TESTS ****\n"

Expand Down
19 changes: 11 additions & 8 deletions tests/Integration/all_integration_server_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ pytest --no-check-dirac-environment "${THIS_DIR}/WorkloadManagementSystem/Test_P
pytest --no-check-dirac-environment "${THIS_DIR}/WorkloadManagementSystem/Test_SandboxMetadataDB.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))
# pytest --no-check-dirac-environment "${THIS_DIR}/WorkloadManagementSystem/Test_JobCleaningAgent.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))

#-------------------------------------------------------------------------------#
echo -e "*** $(date -u) **** RMS TESTS ****\n"
pytest --no-check-dirac-environment "${THIS_DIR}/RequestManagementSystem/Test_ReqDB.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))

#-------------------------------------------------------------------------------#
echo -e "*** $(date -u) **** DMS TESTS ****\n"
pytest --no-check-dirac-environment "${THIS_DIR}/DataManagementSystem/Test_DataIntegrityDB.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))
Expand All @@ -70,12 +74,11 @@ echo -e "*** $(date -u) Restart the DFC service (required for Test_Client_DFC)\
if [[ "${TEST_HTTPS:-Yes}" = "No" ]]; then
dirac-restart-component DataManagement FileCatalog "${DEBUG}" |& tee -a "${SERVER_TEST_OUTPUT}"
fi
dirac-restart-component Tornado Tornado "${DEBUG}" |& tee -a "${SERVER_TEST_OUTPUT}"

echo -e "*** $(date -u) Run the DFC client tests as user without admin privileges" |& tee -a "${SERVER_TEST_OUTPUT}"
echo -e "*** $(date -u) Getting a non privileged user\n" |& tee -a "${SERVER_TEST_OUTPUT}"
# dirac-proxy-init "${DEBUG}"
# python "${THIS_DIR}/DataManagementSystem/Test_Client_DFC.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))
dirac-proxy-init -C /ca/certs/client.pem -K /ca/certs/client.key "${DEBUG}"
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 All @@ -86,19 +89,19 @@ echo -e "*** $(date -u) Restart the DFC service (required for Test_Client_DFC)\
if [[ "${TEST_HTTPS:-Yes}" = "No" ]]; then
dirac-restart-component DataManagement FileCatalog "${DEBUG}" |& tee -a "${SERVER_TEST_OUTPUT}"
fi
# dirac-restart-component Tornado Tornado "${DEBUG}" |& tee -a "${SERVER_TEST_OUTPUT}"

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}"
# python "${THIS_DIR}/DataManagementSystem/Test_Client_DFC.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))
dirac-proxy-init -g prod -C /ca/certs/client.pem -K /ca/certs/client.key "${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 |= "${?}" ))


#-------------------------------------------------------------------------------#
echo -e "*** $(date -u) **** RMS TESTS ****\n"
pytest --no-check-dirac-environment "${THIS_DIR}/RequestManagementSystem/Test_ReqDB.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))
echo -e "*** $(date -u) **** FTS TESTS ****\n"
# I know, it says Client, but it also instantiates a DB, so it needs to be here
pytest --no-check-dirac-environment "${THIS_DIR}/DataManagementSystem/Test_Client_FTS3.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" ))

#-------------------------------------------------------------------------------#
echo -e "*** $(date -u) **** Resources TESTS ****\n"
Expand Down
10 changes: 10 additions & 0 deletions tests/Jenkins/utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ diracUserAndGroup() {
exit 1
fi

if ! dirac-admin-add-user -N pilot -D /C=ch/O=DIRAC/OU=DIRAC\ CI/CN=pilot -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-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
Expand All @@ -361,6 +366,11 @@ diracUserAndGroup() {
exit 1
fi

if ! dirac-admin-add-group -G pilot -U pilot -P GenericPilot,LimitedDelegation VO=vo -o /DIRAC/Security/UseServerCertificate=True "${DEBUG}"; then
echo 'ERROR: dirac-admin-add-group failed' >&2
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
echo 'ERROR: dirac-admin-add-group failed' >&2
exit 1
Expand Down

0 comments on commit 981445d

Please sign in to comment.