From 6f546d861978854b5bef6c20720cd84b8e020bdf Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Mon, 29 Apr 2024 18:49:38 +0200 Subject: [PATCH] test: pilot tests with extended pilots --- tests/.dirac-ci-config.yaml | 34 +++++++++++++++++++++++ tests/CI/run_pilot.sh | 54 +++++-------------------------------- 2 files changed, 40 insertions(+), 48 deletions(-) diff --git a/tests/.dirac-ci-config.yaml b/tests/.dirac-ci-config.yaml index e55e40091b3..126e8a12a65 100644 --- a/tests/.dirac-ci-config.yaml +++ b/tests/.dirac-ci-config.yaml @@ -1,5 +1,39 @@ config: DIRAC_CI_SETUP_SCRIPT: DIRAC/tests/Jenkins/dirac_ci.sh + PILOT_INSTALLATION_COMMAND: dirac-pilot.py --modules /home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC -M 1 -S dirac-JenkinsSetup -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID=whatever12345 --cert --certLocation=/home/dirac/PilotInstallDIR/etc/grid-security --CVMFS_locations=/home/dirac/PilotInstallDIR -o diracInstallOnly --wnVO=vo --debug + PILOT_JSON: "{ + \"timestamp\": \"2023-02-13T14:34:26.725499\", + \"CEs\": { + \"jenkins.cern.ch\": { + \"Site\": \"DIRAC.Jenkins.ch\", + \"GridCEType\": \"TEST-FULL\" + } + }, + \"Defaults\": { + \"Pilot\": { + \"RemoteLogging\": \"False\", + \"Version\": \"integration\", + \"Commands\": { + \"TEST-FULL\": \"CheckWorkerNode, InstallDIRAC, ConfigureBasics, RegisterPilot, CheckCECapabilities, CheckWNCapabilities, ConfigureSite, ConfigureArchitecture, ConfigureCPURequirements, LaunchAgent\" + } + } + }, + \"vo\": { + \"Pilot\": { + \"CheckVersion\": \"False\", + \"pilotFileServer\": \"should_not_matter\", + \"pilotRepoBranch\": \"should_not_matter\", + \"pilotRepo\": \"https://github.com/should_not_matter/Pilot.git\", + \"GenericPilotGroup\": \"dirac_user\", + \"GenericPilotDN\": \"/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser\", + \"PilotLogLevel\": \"DEBUG\" + } + }, + \"ConfigurationServers\": [ + \"https://server:9135/Configuration/Server\" + ] +}" + PILOT_DOWNLOAD_COMMAND: "git clone --single-branch --branch master https://github.com/DIRACGrid/Pilot.git && mv Pilot/Pilot/*.py . && rm -rf Pilot" # List of feature variables which must be passed when preparing required-feature-flags: [] diff --git a/tests/CI/run_pilot.sh b/tests/CI/run_pilot.sh index 4315ac83b83..d5455035327 100755 --- a/tests/CI/run_pilot.sh +++ b/tests/CI/run_pilot.sh @@ -8,60 +8,18 @@ set -eo pipefail # IFS=$'\n\t' set -x -TESTCODE=$PWD/LocalRepo/ALTERNATIVE_MODULES/ -PILOTINSTALLDIR=$PWD/PilotInstallDIR/ - source CONFIG # Creating "the worker node" -cd "${PILOTINSTALLDIR}" +cd /home/dirac/PilotInstallDIR mkdir -p etc/grid-security/vomsdir mkdir -p etc/grid-security/vomses touch etc/grid-security/vomsdir/vomsdir touch etc/grid-security/vomses/vomses -# Get the pilot code -git clone --single-branch -b master https://github.com/DIRACGrid/Pilot.git -mv Pilot/Pilot/*.py . -rm -rf Pilot - -# shellcheck disable=SC2034 -CSURL=https://$SERVER_HOST:9135/Configuration/Server +eval "${PILOT_DOWNLOAD_COMMAND}" -echo " -{ - \"timestamp\": \"2023-02-13T14:34:26.725499\", - \"CEs\": { - \"jenkins.cern.ch\": { - \"Site\": \"DIRAC.Jenkins.ch\", - \"GridCEType\": \"TEST-FULL\" - } - }, - \"Defaults\": { - \"Pilot\": { - \"RemoteLogging\": \"False\", - \"Version\": \"integration\", - \"Commands\": { - \"TEST-FULL\": \"CheckWorkerNode, InstallDIRAC, ConfigureBasics, RegisterPilot, CheckCECapabilities, CheckWNCapabilities, ConfigureSite, ConfigureArchitecture, ConfigureCPURequirements, LaunchAgent\" - } - } - }, - \"vo\": { - \"Pilot\": { - \"CheckVersion\": \"False\", - \"pilotFileServer\": \"should_not_matter\", - \"pilotRepoBranch\": \"should_not_matter\", - \"pilotRepo\": \"https://github.com/should_not_matter/Pilot.git\", - \"GenericPilotGroup\": \"dirac_user\", - \"GenericPilotDN\": \"/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser\", - \"PilotLogLevel\": \"DEBUG\" - } - }, - \"ConfigurationServers\": [ - \"${CSURL}\" - ] -} -" > pilot.json +echo "${PILOT_JSON}" > pilot.json if command -v python &> /dev/null; then py='python' @@ -71,7 +29,7 @@ elif command -v python2 &> /dev/null; then py='python2' fi -pilotUUID="${GITHUB_JOB//-/}""$(shuf -i 2000-65000 -n 1)" -pilotUUID=$(echo "$pilotUUID" | rev | cut -c 1-32 | rev) +more pilot.json -$py dirac-pilot.py --modules "${TESTCODE}/DIRAC" -M 1 -S dirac-JenkinsSetup -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID="${pilotUUID}" --cert --certLocation="${PILOTINSTALLDIR}"/etc/grid-security --CVMFS_locations="${PILOTINSTALLDIR}" -o diracInstallOnly --wnVO=vo --debug +# shellcheck disable=SC2086 +$py ${PILOT_INSTALLATION_COMMAND}