diff --git a/ReleaseNotes.md b/ReleaseNotes.md index a0a77d57e4613038ec81021a120437a770b4a321..a8c09f8d92488b62a6faf533a738385b22c73f45 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,11 @@ +# v4.NEXT + +## Summary +### Features +- cta/CTA#89 - Create stubs for Enstore tape label format +### Continuous Integration +- cta/CTA#49 - Clean up orchestration test scripts + # v4.7.9-2 ## Summary @@ -8,7 +16,6 @@ files were renamed to *configurationfile.rpmsave* and thefore some services and See all details and fix in cta/CTA#119 ### Bug fixes - -cta/CTA#119 [new repo] - Packaging issue with CTA 4.7.8-1/4.7.9-1 # v4.7.9-1 @@ -30,13 +37,13 @@ detailed in the cta-taped man page and the provided example files. The changes a Options which have been renamed: - "general FileCatalogConfigFile" was renamed to "taped CatalogueConfigFile" -to be consistent with other options. +to be consistent with other options. - "DisableRepackManagement" and "DisableMaintenanceProcess" were renamed to "UseRepackManagement" and "UseMaintenanceProcess" with default changed from "no" to "yes" -(default semantics are not changed). +(default semantics are not changed). - "FetchEosFreeSpaceScript" renamed to "externalFreeDiskSpaceScript". -Options for which default values have changed: +Options for which default values have changed: - LogMask, MountCriteria, BufferCount, TapeLoadTimeout, UseRAO, RAOLTOAlgorithm, RAOLTOAlgorithmOptions. diff --git a/continuousintegration/orchestration/tests/grpc_dir_inject.sh b/continuousintegration/orchestration/tests/grpc_dir_inject.sh deleted file mode 100644 index 009a1026dd2b6928defe20202d88621e16985f78..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/grpc_dir_inject.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -# Migration tools parameters -#EOSINSTANCE=ctaeos -#EOS_CMD="/usr/bin/eos root://${EOSINSTANCE}" -EOS_CMD="/usr/bin/eos" -EOS_TEST_DIR_INJECT=/usr/bin/eos-test-dir-inject -CONFIG_FILE=/etc/cta/castor-migration.conf -TMPFILE=/tmp/eos-test-inject-sh.$$ - -# Colours -NC='\033[0m' # No colour -RED='\033[0;31m' -LT_RED='\033[1;31m' -GREEN='\033[0;32m' -LT_GREEN='\033[1;32m' -ORANGE='\033[0;33m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -LT_BLUE='\033[1;34m' - -error() -{ - echo -e "${RED}$*${NC}" >&2 - if [ -r ${TMPFILE} ] - then - json-pretty-print.sh ${TMPFILE} - fi - exit 1 -} - -echoc() -{ - COLOUR=$1 - shift - echo -e "${COLOUR}$*${NC}" -} - -[ -x ${EOS_TEST_DIR_INJECT} ] || error "Can't find executable ${EOS_TEST_DIR_INJECT}" -[ -r ${CONFIG_FILE} ] || error "Can't find configuration file ${CONFIG_FILE}" -CASTOR_PREFIX=$(awk '/^castor.prefix[ ]/ { print $2 }' ${CONFIG_FILE}) -EOS_PREFIX=$(awk '/^eos.prefix[ ]/ { print $2 }' ${CONFIG_FILE}) - -echoc $LT_BLUE "gRPC configuration:" -cat ${CONFIG_FILE} - -# Ping the gRPC interface -${EOS_TEST_DIR_INJECT} ping || error "gRPC ping failed" - -# Create the top-level directory. -# -# Note: GNU coreutils "mkdir -p" does not return an error if the directory already exists; -# but "eos mkdir -p" does return an error. -echo Creating ${EOS_PREFIX}... -${EOS_CMD} mkdir -p ${EOS_PREFIX} - -# Create directory with system-assigned file id -- should succeed -echoc $LT_BLUE "Creating directory with auto-assigned file id" -${EOS_TEST_DIR_INJECT} --path ${CASTOR_PREFIX}/test_dir1 >${TMPFILE} -[ $? -eq 0 ] || error "Creating directory with auto-assigned file id failed" -json-pretty-print.sh ${TMPFILE} -rm ${TMPFILE} -${EOS_CMD} ls -l ${EOS_PREFIX} -${EOS_CMD} fileinfo ${EOS_PREFIX}/test_dir1 -${EOS_CMD} attr ls ${EOS_PREFIX}/test_dir1 -/usr/bin/eos root://${EOSINSTANCE} rmdir ${EOS_PREFIX}/test_dir1 - -# Create directory with self-assigned file id -- should succeed -TEST_FILE_ID=123456789 -echoc $LT_BLUE "Creating directory with self-assigned file id" -${EOS_TEST_DIR_INJECT} --fileid ${TEST_FILE_ID} --path ${CASTOR_PREFIX}/test_dir2 >${TMPFILE} -[ $? -eq 0 ] || error "Creating directory with self-assigned file id failed" -json-pretty-print.sh ${TMPFILE} -rm ${TMPFILE} -${EOS_CMD} fileinfo ${EOS_PREFIX}/test_dir2 - -# Try again -- should fail -echoc $LT_GREEN "Creating directory with the same path (should fail)" -${EOS_TEST_DIR_INJECT} --path ${CASTOR_PREFIX}/test_dir2 >/dev/null -[ $? -ne 0 ] || error "Creating directory with self-assigned file id succeeded when it should have failed" - -# Try again -- should fail -echoc $LT_GREEN "Creating directory with the same file id (should fail)" -${EOS_TEST_DIR_INJECT} --fileid ${TEST_FILE_ID} --path ${CASTOR_PREFIX}/test_dir3 >/dev/null -[ $? -ne 0 ] || error "Creating directory with self-assigned file id succeeded when it should have failed" - -# Remove and try again -- should succeed -echoc $LT_GREEN "Remove the directory and tombstone" -${EOS_CMD} rmdir ${EOS_PREFIX}/test_dir2 -${EOS_CMD} ns cache drop-single-container ${TEST_FILE_ID} - -echoc $LT_BLUE "Recreate the directory with self-assigned file id (should succeed this time)" -${EOS_TEST_DIR_INJECT} --fileid ${TEST_FILE_ID} --path ${CASTOR_PREFIX}/test_dir2 >/dev/null -[ $? -eq 0 ] || error "Creating directory with self-assigned file id failed with error $?" -${EOS_CMD} fileinfo ${EOS_PREFIX}/test_dir2 -${EOS_CMD} rmdir ${EOS_PREFIX}/test_dir2 diff --git a/continuousintegration/orchestration/tests/migration.sh b/continuousintegration/orchestration/tests/migration.sh deleted file mode 100755 index ead0e1553ace6f4937e871fcc532d5b76a3e1e92..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/migration.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -usage() { cat <<EOF 1>&2 -Usage: $0 -n <namespace> -EOF -exit 1 -} - -while getopts "n:" o; do - case "${o}" in - n) - NAMESPACE=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${NAMESPACE}" ]; then - usage -fi - -if [ ! -z "${error}" ]; then - echo -e "ERROR:\n${error}" - exit 1 -fi - -echo "Preparing namespace for the tests" -./prepare_tests.sh -n ${NAMESPACE} -if [ $? -ne 0 ]; then - echo "ERROR: failed to prepare namespace for the tests" - exit 1 -fi - -echo -echo "Launching grpc_dir_inject.sh on ctaeos pod" -kubectl -n ${NAMESPACE} cp grpc_dir_inject.sh ctaeos:/root/grpc_dir_inject.sh -kubectl -n ${NAMESPACE} exec ctaeos -- bash /root/grpc_dir_inject.sh || exit 1 - -exit 0 diff --git a/continuousintegration/orchestration/tests/multiple_repack.sh b/continuousintegration/orchestration/tests/multiple_repack.sh deleted file mode 100755 index b504870f3f2b3d1c3b15776eed5e4fc1840b5291..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/multiple_repack.sh +++ /dev/null @@ -1,192 +0,0 @@ -#!/bin/bash - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -#default CI EOS instance -EOSINSTANCE=ctaeos -EOSBASEDIR=/eos/ctaeos/preprod - -#default Repack timeout -WAIT_FOR_REPACK_TIMEOUT=300 - -die() { - echo "$@" 1>&2 - test -z $TAILPID || kill ${TAILPID} &> /dev/null - exit 1 -} - -usage() { cat <<EOF 1>&2 -Usage: $0 -s <size_of_tapes> -n <nb_files_per_tape> -b <repack_buffer_url> [-e <eosinstance>] [-d <eosbasedir>] [-t <timeout>] -size_of_tape : in MB -repack_buffer_url example : /eos/ctaeos/repack -eosinstance : the name of the ctaeos instance to be used (default ctaeos) -eosbasedir : the path in which files will be created for archival -timeout : the timeout in seconds to wait for each repack request to be complete -EOF -exit 1 -} - -if [ $# -lt 6 ] -then - usage -fi; - -while getopts "s:n:e:t:b:d:" o; do - case "${o}" in - s) - SIZE_OF_TAPES=${OPTARG} - ;; - n) - NB_FILES_PER_TAPE=${OPTARG} - ;; - e) - EOSINSTANCE=${OPTARG} - ;; - t) - WAIT_FOR_REPACK_TIMEOUT=${OPTARG} - ;; - b) - REPACK_BUFFER_URL=${OPTARG} - ;; - d) - EOSBASEDIR=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND -1)) - -if [ -z "${SIZE_OF_TAPES}" ]; then - usage -fi - -if [ -z "${NB_FILES_PER_TAPE}" ]; then - usage -fi - -if [ -z "${REPACK_BUFFER_URL}" ]; then - usage -fi - -echo "Starting multiple repack test" - -. /root/client_helper.sh - -# Get kerberos credentials for user1 -admin_kinit -admin_klist > /dev/null 2>&1 || die "Cannot get kerberos credentials for user ${USER}" - -# Get the number of tapes available -# availableTapes=`admin_cta --json ta ls --all | jq -r ".[] | select (.occupancy==\"0\") | .vid"` -availableTapes=`admin_cta --json ta ls --all | jq -r ".[] | select (.full==false) | .vid"` - -# Save the available tapes in an array -read -a arrayTapes <<< $availableTapes -nbTapes=${#arrayTapes[@]} - -#Get the tapes that we will repack -nbTapesToRepack=$(($nbTapes/2)) -tapesToRepack=() -for ((i=0; i<nbTapesToRepack; i++)) -do - tapesToRepack+=(${arrayTapes[$i]}) -done - -destinationTapes=() -for (( i=$(($nbTapesToRepack)); i<nbTapes; i++ )) -do - destinationTapes+=(${arrayTapes[$i]}) -done - -# Mark repack destination tape as full, we don't want to archive on them -for vid in ${destinationTapes[@]} -do - echo "Marking repack destination tape (${vid}) as full" - admin_cta tape ch --vid $vid --full true -done - -nbDestinationTape=${#destinationTapes[@]} - -# Compute the number of files to copy and the size of each file -fileSizeToCopy=`perl -e "use POSIX; print int( ceil((( (${SIZE_OF_TAPES} * 1000) - ((6 * 80) / 1000)) / ${NB_FILES_PER_TAPE})) )"` -nbFilesToCopy=$(($NB_FILES_PER_TAPE * $nbTapesToRepack)) - -echo -echo "file size to copy (in KB) = $fileSizeToCopy" -echo "Nb files to copy = $nbFilesToCopy" - -bash /root/client_ar.sh -n ${nbFilesToCopy} -s ${fileSizeToCopy} -p 100 -d ${EOSBASEDIR} -v -A || exit 1 - -for vid in ${destinationTapes[@]} -do - echo "Marking destination tape (${vid}) as not full" - admin_cta tape ch --vid $vid --full false -done - -allPid=() -for vid in ${tapesToRepack[@]} -do - echo "Launching repack requests on vid $vid" - bash /root/repack_systemtest.sh -v $vid -b ${REPACK_BUFFER_URL} -t 500 -n ctasystest & - allPid+=($!) -done - -oneRepackFailed=0 -for pid in ${allPid[@]} -do - wait $pid || oneRepackFailed=1 -done - -if [[ $oneRepackFailed == 1 ]] -then - die "Fail of multiple_repack test" -fi - -echo "End of multiple_repack test" - -#WAIT_FOR_REPACK_TIMEOUT=300 -# -#while test $nbTapesToRepack != `admin_cta --json re ls | jq "[.[] | select(.status == \"Complete\" or .status == \"Failed\")] | length"`; do -# echo "Waiting for repack request on all tapes to be complete: Seconds passed = $SECONDS_PASSED" -# sleep 1 -# let SECONDS_PASSED=SECONDS_PASSED+1 -# -# if test ${SECONDS_PASSED} == ${WAIT_FOR_REPACK_TIMEOUT}; then -# echo "Timed out after ${WAIT_FOR_REPACK_TIMEOUT} seconds waiting all tapes to be repacked" -# exit 1 -# fi -#done -# -#successfulRepackTapes=`admin_cta --json re ls | jq ".[] | select(.status == \"Complete\") | .vid"` -#failedToRepackTapes=`admin_cta --json re ls | jq ".[] | select(.status == \"Failed\") | .vid"` -# -#read -a arrayFailedToRepackTapes <<< $failedToRepackTapes -# -#if test 0 != ${#arrayFailedToRepackTapes[@]} then -# echo "Repack failed for tapes ${arrayFailedToRepackTapes[@]}." -# exit 1 -#else -# for vid in $successfulRepackTapes[@] -# do -# bash /root/repack_generate_report.sh -v $vid -# done -# echo "End of multiple repack test" -# exit 0 -#fi - -# echo $nb_tapes_to_fill diff --git a/continuousintegration/orchestration/tests/multiple_repack_wrapper.sh b/continuousintegration/orchestration/tests/multiple_repack_wrapper.sh deleted file mode 100755 index ac77fac02924214c168fb6d846e7a3a10ea9e4f8..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/multiple_repack_wrapper.sh +++ /dev/null @@ -1,74 +0,0 @@ -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -#default CI EOS instance -EOSINSTANCE=ctaeos -#default Repack timeout -WAIT_FOR_REPACK_TIMEOUT=300 - -die() { - echo "$@" 1>&2 - test -z $TAILPID || kill ${TAILPID} &> /dev/null - exit 1 -} - -usage() { cat <<EOF 1>&2 -Usage: $0 -n <namespace> -EOF -exit 1 -} - -while getopts "n:" o; do - case "${o}" in - n) - NAMESPACE=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${NAMESPACE}" ]; then - usage -fi - -if [ ! -z "${error}" ]; then - echo -e "ERROR:\n${error}" - exit 1 -fi - -echo "Preparing namespace for the tests" -./prepare_tests.sh -n ${NAMESPACE} - -kubectl -n ${NAMESPACE} cp client_helper.sh client:/root/client_helper.sh -kubectl -n ${NAMESPACE} cp client_ar.sh client:/root/client_ar.sh -kubectl -n ${NAMESPACE} cp multiple_repack.sh client:/root/multiple_repack.sh -kubectl -n ${NAMESPACE} cp repack_systemtest.sh client:/root/repack_systemtest.sh - -NB_FILES_PER_TAPE=1000 - -SIZE_OF_TAPES=10 - -REPACK_BUFFER_URL=/eos/ctaeos/repack -echo "Creating the repack buffer URL directory (${REPACK_BUFFER_URL})" -kubectl -n ${NAMESPACE} exec ctaeos -- eos mkdir ${REPACK_BUFFER_URL} -kubectl -n ${NAMESPACE} exec ctaeos -- eos chmod 1777 ${REPACK_BUFFER_URL} - -echo "Enabling all drives" -kubectl -n ${NAMESPACE} exec ctacli -- cta-admin dr up ".*" - -kubectl -n ${NAMESPACE} exec client -- bash /root/multiple_repack.sh -n ${NB_FILES_PER_TAPE} -s ${SIZE_OF_TAPES} -b ${REPACK_BUFFER_URL} || exit 1 diff --git a/continuousintegration/orchestration/tests/simple_repack.sh b/continuousintegration/orchestration/tests/simple_repack.sh deleted file mode 100755 index 3f4c448c58438c681e2244a2824c7bba602c4749..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/simple_repack.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -usage() { cat <<EOF 1>&2 -Usage: $0 -n <namespace> -EOF -exit 1 -} - -while getopts "n:" o; do - case "${o}" in - n) - NAMESPACE=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${NAMESPACE}" ]; then - usage -fi - -if [ ! -z "${error}" ]; then - echo -e "ERROR:\n${error}" - exit 1 -fi - -echo -echo "Launching a round trip repack request" -kubectl -n ${NAMESPACE} cp repack_systemtest.sh client:/root/repack_systemtest.sh -source ./repack_helper.sh - -REPACK_BUFFER_URL=/eos/ctaeos/repack -echo "Creating the repack buffer URL directory (${REPACK_BUFFER_URL})" -kubectl -n ${NAMESPACE} exec ctaeos -- eos mkdir ${REPACK_BUFFER_URL} -kubectl -n ${NAMESPACE} exec ctaeos -- eos chmod 1777 ${REPACK_BUFFER_URL} - -VID_TO_REPACK=$(getFirstVidContainingFiles) -if [ "$VID_TO_REPACK" != "null" ] -then -echo - echo "Marking the tape ${VID_TO_REPACK} as full" - kubectl -n ${NAMESPACE} exec ctacli -- cta-admin tape ch --vid ${VID_TO_REPACK} -f true - echo "Launching the repack test on VID ${VID_TO_REPACK}" - kubectl -n ${NAMESPACE} exec client -- bash /root/repack_systemtest.sh -v ${VID_TO_REPACK} -b ${REPACK_BUFFER_URL} -n ctasystest -else - echo "No vid found to repack" - exit 1 -fi - -echo "Reclaiming tape ${VID_TO_REPACK}" -kubectl -n ${NAMESPACE} exec ctacli -- cta-admin tape reclaim --vid ${VID_TO_REPACK} - -VID_TO_REPACK=$(getFirstVidContainingFiles) -if [ "$VID_TO_REPACK" != "null" ] -then -echo - echo "Marking the tape ${VID_TO_REPACK} as full" - kubectl -n ${NAMESPACE} exec ctacli -- cta-admin tape ch --vid ${VID_TO_REPACK} -f true - echo "Launching the repack test on VID ${VID_TO_REPACK}" - kubectl -n ${NAMESPACE} exec client -- bash /root/repack_systemtest.sh -v ${VID_TO_REPACK} -b ${REPACK_BUFFER_URL} -n ctasystest -else - echo "No vid found to repack" - exit 1 -fi - -echo "Reclaiming tape ${VID_TO_REPACK}" -kubectl -n ${NAMESPACE} exec ctacli -- cta-admin tape reclaim --vid ${VID_TO_REPACK} diff --git a/continuousintegration/orchestration/tests/simpletest.cli.sh b/continuousintegration/orchestration/tests/simpletest.cli.sh deleted file mode 100755 index 2b926f2eb6336eb93fd5b7d54e2975a4f8987fb1..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/simpletest.cli.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -cta bs -u root --hostname $(hostname -i) -m "docker cli" - -cta logicallibrary add --name VLSTK --comment "ctasystest" - -cta tapepool add --name ctasystest --partialtapesnumber 5 --encrypted false --comment "ctasystest" - -cta tape add --logicallibrary VLSTK --tapepool ctasystest --capacity 1000000000 --comment "ctasystest" --vid ${VID} --full false - -cta storageclass add --instance root --name ctaStorageClass --numberofcopies 1 --comment "ctasystest" - -cta archiveroute add --instance root --storageclass ctaStorageClass --copynb 1 --tapepool ctasystest --comment "ctasystest" - -cta mountpolicy add --name ctasystest --archivepriority 1 --minarchiverequestage 1 --retrievepriority 1 --minretrieverequestage 1 --comment "ctasystest" - -cta requestermountrule add --instance root --name root --mountpolicy ctasystest --comment "ctasystest" - -cta drive up VDSTK1 diff --git a/continuousintegration/orchestration/tests/simpletest.mgm.sh b/continuousintegration/orchestration/tests/simpletest.mgm.sh deleted file mode 100644 index 595b0b46ff13e96eaed5994e2488ebf732209615..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/simpletest.mgm.sh +++ /dev/null @@ -1,22 +0,0 @@ -# example test - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -kubectl --namespace ${NAMESPACE} exec mgm xrdcp /etc/group root://localhost//eos/mgm/cta/toto - -kubectl --namespace ${NAMESPACE} exec mgm eos file workflow /eos/mgm/cta/toto default closew - -kubectl --namespace ${NAMESPACE} exec mgm eos file workflow /eos/mgm/cta/toto default prepare diff --git a/continuousintegration/orchestration/tests/systest.sh b/continuousintegration/orchestration/tests/systest.sh deleted file mode 100755 index 910663605ef9e4cdd68af703c246cd67e568c79a..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/systest.sh +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/bash - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -usage() { cat <<EOF 1>&2 -Usage: $0 -n <namespace> -EOF -exit 1 -} - -while getopts "n:" o; do - case "${o}" in - n) - NAMESPACE=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${NAMESPACE}" ]; then - usage -fi - -if [ ! -z "${error}" ]; then - echo -e "ERROR:\n${error}" - exit 1 -fi - - -# eos instance identified by SSS username -EOSINSTANCE=ctaeos - -tempdir=$(mktemp -d) # temporary directory for system test related config -echo -n "Reading library configuration from tpsrv01" -SECONDS_PASSED=0 -while test 0 = $(kubectl --namespace ${NAMESPACE} exec tpsrv01 -c taped -- cat /tmp/library-rc.sh | sed -e 's/^export//' | tee ${tempdir}/library-rc.sh | wc -l); do - sleep 1 - echo -n . - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == 30; then - echo "FAILED" - echo "Timed out after ${SECONDS_PASSED} seconds waiting for file to be archived to tape" - exit 1 - fi -done -echo "OK" - -echo "Using this configuration for library:" -cat ${tempdir}/library-rc.sh -. ${tempdir}/library-rc.sh - -#clean the library -# echo "Clean the library /dev/${LIBRARYDEVICE} if needed" -# mtx -f /dev/${LIBRARYDEVICE} status | sed -e "s/:/ /g"| grep "Full" | awk '{if ($1=="Data" ) { rewind="mt -f /dev/${DRIVEDEVICES["$4"]} rewind"; print rewind; print "Rewind drive "$4>"/dev/stderr"; unload="mtx -f /dev/${LIBRARYDEVICE} unload "$8" "$4; print unload; print "Unloading to storage slot "$8" from data slot "$4"" >"/dev/stderr";}}' | source /dev/stdin - -ctacliIP=`kubectl --namespace ${NAMESPACE} describe pod ctacli | grep IP | sed -E 's/IP:[[:space:]]+//'` - -echo "Preparing CTA for tests" - kubectl --namespace ${NAMESPACE} exec ctafrontend -- cta-catalogue-admin-user-create /etc/cta/cta-catalogue.conf --username admin1 -m "docker cli" - kubectl --namespace ${NAMESPACE} exec ctacli -- cta logicallibrary add \ - --name ${LIBRARYNAME} \ - --comment "ctasystest" - kubectl --namespace ${NAMESPACE} exec ctacli -- cta tapepool add \ - --name ctasystest \ - --partialtapesnumber 5 \ - --encrypted false \ - --comment "ctasystest" - # add all tapes - for ((i=0; i<${#TAPES[@]}; i++)); do - VID=${TAPES[${i}]} - kubectl --namespace ${NAMESPACE} exec ctacli -- cta tape add \ - --logicallibrary ${LIBRARYNAME} \ - --tapepool ctasystest \ - --capacity 1000000000 \ - --comment "ctasystest" \ - --vid ${VID} \ - --full false \ - --comment "ctasystest" - done - kubectl --namespace ${NAMESPACE} exec ctacli -- cta storageclass add \ - --instance ${EOSINSTANCE} \ - --name ctaStorageClass \ - --numberofcopies 1 \ - --comment "ctasystest" - kubectl --namespace ${NAMESPACE} exec ctacli -- cta archiveroute add \ - --instance ${EOSINSTANCE} \ - --storageclass ctaStorageClass \ - --copynb 1 \ - --tapepool ctasystest \ - --comment "ctasystest" - kubectl --namespace ${NAMESPACE} exec ctacli -- cta mountpolicy add \ - --name ctasystest \ - --archivepriority 1 \ - --minarchiverequestage 1 \ - --retrievepriority 1 \ - --minretrieverequestage 1 \ - --comment "ctasystest" - kubectl --namespace ${NAMESPACE} exec ctacli -- cta requestermountrule add \ - --instance ${EOSINSTANCE} \ - --name adm \ - --mountpolicy ctasystest --comment "ctasystest" -### -# This rule exists to allow users from eosusers group to migrate files to tapes - kubectl --namespace ${NAMESPACE} exec ctacli -- cta groupmountrule add \ - --instance ${EOSINSTANCE} \ - --name eosusers \ - --mountpolicy ctasystest --comment "ctasystest" -### -# This rule exists to allow users from powerusers group to recall files from tapes - kubectl --namespace ${NAMESPACE} exec ctacli -- cta groupmountrule add \ - --instance ${EOSINSTANCE} \ - --name powerusers \ - --mountpolicy ctasystest --comment "ctasystest" - - kubectl --namespace ${NAMESPACE} exec ctacli -- cta drive up ${DRIVENAMES[${driveslot}]} - -# testing - echo "EOS server version is used:" - kubectl --namespace ${NAMESPACE} exec ctaeos -- rpm -qa|grep eos-server - TEST_FILE_NAME=`uuidgen` - echo "xrdcp /etc/group root://localhost//eos/ctaeos/cta/${TEST_FILE_NAME}" - kubectl --namespace ${NAMESPACE} exec ctaeos -- xrdcp /etc/group root://localhost//eos/ctaeos/cta/${TEST_FILE_NAME} - - SECONDS_PASSED=0 - WAIT_FOR_ARCHIVED_FILE_TIMEOUT=90 - while test 0 = `kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} | awk '{print $4;}' | grep tape | wc -l`; do - echo "Waiting for file to be archived to tape: Seconds passed = ${SECONDS_PASSED}" - sleep 1 - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == ${WAIT_FOR_ARCHIVED_FILE_TIMEOUT}; then - echo "Timed out after ${WAIT_FOR_ARCHIVED_FILE_TIMEOUT} seconds waiting for file to be archived to tape" - exit 1 - fi - done - echo - echo "FILE ARCHIVED TO TAPE" - echo - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} - echo - echo "Information about the testing file:" - echo "********" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos attr ls /eos/ctaeos/cta/${TEST_FILE_NAME} - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} - echo - echo "Removing disk replica" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos -r 0 0 file drop /eos/ctaeos/cta/${TEST_FILE_NAME} 1 - echo - echo "Information about the testing file without disk replica" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} - echo - echo "trigger EOS retrieve workflow" - echo "xrdfs localhost prepare -s /eos/ctaeos/cta/${TEST_FILE_NAME}" - kubectl --namespace ${NAMESPACE} exec ctaeos -- xrdfs localhost prepare -s /eos/ctaeos/cta/${TEST_FILE_NAME} - - # Wait for the copy to appear on disk - SECONDS_PASSED=0 - WAIT_FOR_RETRIEVED_FILE_TIMEOUT=90 - while test 0 = `kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} | awk '{print $4;}' | grep -F "default.0" | wc -l`; do - echo "Waiting for file to be retrieved from tape: Seconds passed = ${SECONDS_PASSED}" - sleep 1 - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == ${WAIT_FOR_RETRIEVED_FILE_TIMEOUT}; then - echo "Timed out after ${WAIT_FOR_RETRIEVED_FILE_TIMEOUT} seconds waiting for file to be retrieved from tape" - exit 1 - fi - done - echo - echo "FILE RETRIEVED FROM DISK" - echo - echo "Information about the testing file:" - echo "********" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos attr ls /eos/ctaeos/cta/${TEST_FILE_NAME} - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} - -# results - echo - msgNum=`kubectl --namespace $NAMESPACE logs tpsrv01 -c taped | grep "\"File suc" | grep ${TEST_FILE_NAME} | tail -n 4|wc -l` - if [ $msgNum == "4" ]; then - echo "OK: all tests passed" - rc=0 - else - echo "FAIL: tests failed" - rc=1 - fi - - -rm -fr ${tempdir} - -exit $rc diff --git a/continuousintegration/orchestration/tests/systest_xrdcp_many_concurrent_files.sh b/continuousintegration/orchestration/tests/systest_xrdcp_many_concurrent_files.sh deleted file mode 100755 index a9591702aeaed58e0d267603a852bb55bc88942c..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/systest_xrdcp_many_concurrent_files.sh +++ /dev/null @@ -1,210 +0,0 @@ -#!/bin/bash - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -usage() { cat <<EOF 1>&2 -Usage: $0 -n <namespace> -EOF -exit 1 -} - -while getopts "n:" o; do - case "${o}" in - n) - NAMESPACE=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${NAMESPACE}" ]; then - usage -fi - -if [ ! -z "${error}" ]; then - echo -e "ERROR:\n${error}" - exit 1 -fi - - -# eos instance identified by SSS username -EOSINSTANCE=ctaeos - -tempdir=$(mktemp -d) # temporary directory for system test related config -echo -n "Reading library configuration from tpsrv" -SECONDS_PASSED=0 -while test 0 = $(kubectl --namespace ${NAMESPACE} exec tpsrv -c taped -- cat /tmp/library-rc.sh | sed -e 's/^export//' | tee ${tempdir}/library-rc.sh | wc -l); do - sleep 1 - echo -n . - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == 30; then - echo "FAILED" - echo "Timed out after ${SECONDS_PASSED} seconds waiting for file to be archived to tape" - exit 1 - fi -done -echo "OK" - -echo "Using this configuration for library:" -cat ${tempdir}/library-rc.sh -. ${tempdir}/library-rc.sh - -#clean the library -# echo "Clean the library /dev/${LIBRARYDEVICE} if needed" -# mtx -f /dev/${LIBRARYDEVICE} status | sed -e "s/:/ /g"| grep "Full" | awk '{if ($1=="Data" ) { rewind="mt -f /dev/${DRIVEDEVICES["$4"]} rewind"; print rewind; print "Rewind drive "$4>"/dev/stderr"; unload="mtx -f /dev/${LIBRARYDEVICE} unload "$8" "$4; print unload; print "Unloading to storage slot "$8" from data slot "$4"" >"/dev/stderr";}}' | source /dev/stdin - -ctacliIP=`kubectl --namespace ${NAMESPACE} describe pod ctacli | grep IP | sed -E 's/IP:[[:space:]]+//'` - -echo "Preparing CTA for tests" -kubectl --namespace ${NAMESPACE} exec ctafrontend -- cta-catalogue-admin-user-create /etc/cta/cta-catalogue.conf --username admin1 -m "docker cli" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta logicallibrary add \ - --name ${LIBRARYNAME} \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta tapepool add \ - --name ctasystest \ - --partialtapesnumber 5 \ - --encrypted false \ - --comment "ctasystest" -# add all tapes -for ((i=0; i<${#TAPES[@]}; i++)); do - VID=${TAPES[${i}]} - kubectl --namespace ${NAMESPACE} exec ctacli -- cta tape add \ - --logicallibrary ${LIBRARYNAME} \ - --tapepool ctasystest \ - --capacity 1000000000 \ - --comment "ctasystest" \ - --vid ${VID} \ - --disabled false \ - --full false \ - --readonly false \ - --comment "ctasystest" -done - -kubectl --namespace ${NAMESPACE} exec ctacli -- cta storageclass add \ - --instance ${EOSINSTANCE} \ - --name ctaStorageClass \ - --numberofcopies 1 \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta archiveroute add \ - --instance ${EOSINSTANCE} \ - --storageclass ctaStorageClass \ - --copynb 1 \ - --tapepool ctasystest \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta mountpolicy add \ - --name ctasystest \ - --archivepriority 1 \ - --minarchiverequestage 1 \ - --retrievepriority 1 \ - --minretrieverequestage 1 \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta requestermountrule add \ - --instance ${EOSINSTANCE} \ - --name adm \ - --mountpolicy ctasystest --comment "ctasystest" - -kubectl --namespace ${NAMESPACE} exec ctacli -- cta drive up ${DRIVENAMES[${driveslot}]} - -# testing -echo "EOS server version is used:" -kubectl --namespace ${NAMESPACE} exec ctaeos -- rpm -qa|grep eos-server - -NB_FILES=1000 -NB_CONCURRENT_TRANSFERS=20 - -# Delete any existing test files -echo "Deleting ${NB_FILES} test files in batches of ${NB_CONCURRENT_TRANSFERS} concurrent deletes" -for I in `seq 1 ${NB_FILES}`; do - echo eos rm /eos/ctaeos/cta/test_file_${I}; -done | xargs -L 1 -P ${NB_CONCURRENT_TRANSFERS} kubectl --namespace ${NAMESPACE} exec ctaeos -- - -# Copy test files into EOS -echo "Copying ${NB_FILES} test files in batches of ${NB_CONCURRENT_TRANSFERS} concurrent transfers" -for I in `seq 1 ${NB_FILES}`; do - echo xrdcp /etc/group root://localhost//eos/ctaeos/cta/test_file_${I}; -done | xargs -L 1 -P ${NB_CONCURRENT_TRANSFERS} kubectl --namespace ${NAMESPACE} exec ctaeos -- - -# Wait for test files to be archived to tape -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - SECONDS_PASSED=0 - WAIT_FOR_ARCHIVED_FILE_TIMEOUT=90 - while test 0 = `kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} | awk '{print $4;}' | grep tape | wc -l`; do - echo "Waiting for file to be archived to tape: Seconds passed = ${SECONDS_PASSED}" - sleep 1 - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == ${WAIT_FOR_ARCHIVED_FILE_TIMEOUT}; then - echo "Timed out after ${WAIT_FOR_ARCHIVED_FILE_TIMEOUT} seconds waiting for file to be archived to tape" - exit 1 - fi - done - echo - echo "${TEST_FILE_NAME} ARCHIVED TO TAPE" -done - -echo "Removing the disk replicas of ${NB_FILES} test files in batches of ${NB_CONCURRENT_TRANSFERS} concurrent removes" -for I in `seq 1 ${NB_FILES}`; do - echo eos -r 0 0 file drop /eos/ctaeos/cta/test_file_${I} 1 -done | xargs -L 1 -P ${NB_CONCURRENT_TRANSFERS} kubectl --namespace ${NAMESPACE} exec ctaeos -- - -echo "Requesting ${NB_FILES} test files be retrieved from tape in batches of ${NB_CONCURRENT_TRANSFERS} concurrent transfers" -for I in `seq 1 ${NB_FILES}`; do - echo xrdfs localhost prepare -s /eos/ctaeos/cta/test_file_${I}; -done | xargs -L 1 -P ${NB_CONCURRENT_TRANSFERS} kubectl --namespace ${NAMESPACE} exec ctaeos -- - -# Wait for the test files to be retrieved from tape -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - # Wait for the copy to appear on disk - SECONDS_PASSED=0 - WAIT_FOR_RETRIEVED_FILE_TIMEOUT=90 - while test 0 = `kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} | awk '{print $4;}' | grep -F "default.0" | wc -l`; do - echo "Waiting for file to be retrieved from tape: Seconds passed = ${SECONDS_PASSED}" - sleep 1 - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == ${WAIT_FOR_RETRIEVED_FILE_TIMEOUT}; then - echo "Timed out after ${WAIT_FOR_RETRIEVED_FILE_TIMEOUT} seconds waiting for file to be retrieved from tape" - exit 1 - fi - done - echo - echo "${TEST_FILE_NAME} RETRIEVED FROM DISK" - echo -done - -# results -echo -#msgNum=`kubectl --namespace $NAMESPACE logs tpsrv -c taped | grep "\"File suc" | grep ${TEST_FILE_NAME} | tail -n 4|wc -l` -#if [ $msgNum == "4" ]; then -# echo "OK: all tests passed" -# rc=0 -#else -# echo "FAIL: tests failed" -# rc=1 -#fi - -echo "OK: all tests passed" -rc=0 - -rm -fr ${tempdir} - -exit $rc diff --git a/continuousintegration/orchestration/tests/systest_xrdcp_many_files.sh b/continuousintegration/orchestration/tests/systest_xrdcp_many_files.sh deleted file mode 100755 index 8f8a2680603ab44d151e80262107f3d267a0965b..0000000000000000000000000000000000000000 --- a/continuousintegration/orchestration/tests/systest_xrdcp_many_files.sh +++ /dev/null @@ -1,229 +0,0 @@ -#!/bin/bash - -# @project The CERN Tape Archive (CTA) -# @copyright Copyright © 2022 CERN -# @license This program is free software, distributed under the terms of the GNU General Public -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can -# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -usage() { cat <<EOF 1>&2 -Usage: $0 -n <namespace> -EOF -exit 1 -} - -while getopts "n:" o; do - case "${o}" in - n) - NAMESPACE=${OPTARG} - ;; - *) - usage - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${NAMESPACE}" ]; then - usage -fi - -if [ ! -z "${error}" ]; then - echo -e "ERROR:\n${error}" - exit 1 -fi - - -# eos instance identified by SSS username -EOSINSTANCE=ctaeos - -tempdir=$(mktemp -d) # temporary directory for system test related config -echo -n "Reading library configuration from tpsrv" -SECONDS_PASSED=0 -while test 0 = $(kubectl --namespace ${NAMESPACE} exec tpsrv -c taped -- cat /tmp/library-rc.sh | sed -e 's/^export//' | tee ${tempdir}/library-rc.sh | wc -l); do - sleep 1 - echo -n . - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == 30; then - echo "FAILED" - echo "Timed out after ${SECONDS_PASSED} seconds waiting for file to be archived to tape" - exit 1 - fi -done -echo "OK" - -echo "Using this configuration for library:" -cat ${tempdir}/library-rc.sh -. ${tempdir}/library-rc.sh - -#clean the library -# echo "Clean the library /dev/${LIBRARYDEVICE} if needed" -# mtx -f /dev/${LIBRARYDEVICE} status | sed -e "s/:/ /g"| grep "Full" | awk '{if ($1=="Data" ) { rewind="mt -f /dev/${DRIVEDEVICES["$4"]} rewind"; print rewind; print "Rewind drive "$4>"/dev/stderr"; unload="mtx -f /dev/${LIBRARYDEVICE} unload "$8" "$4; print unload; print "Unloading to storage slot "$8" from data slot "$4"" >"/dev/stderr";}}' | source /dev/stdin - -ctacliIP=`kubectl --namespace ${NAMESPACE} describe pod ctacli | grep IP | sed -E 's/IP:[[:space:]]+//'` - -echo "Preparing CTA for tests" -kubectl --namespace ${NAMESPACE} exec ctafrontend -- cta-catalogue-admin-user-create /etc/cta/cta-catalogue.conf --username admin1 -m "docker cli" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta logicallibrary add \ - --name ${LIBRARYNAME} \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta tapepool add \ - --name ctasystest \ - --partialtapesnumber 5 \ - --encrypted false \ - --comment "ctasystest" -# add all tapes -for ((i=0; i<${#TAPES[@]}; i++)); do - VID=${TAPES[${i}]} - kubectl --namespace ${NAMESPACE} exec ctacli -- cta tape add \ - --logicallibrary ${LIBRARYNAME} \ - --tapepool ctasystest \ - --capacity 1000000000 \ - --comment "ctasystest" \ - --vid ${VID} \ - --full false \ - --comment "ctasystest" -done - -kubectl --namespace ${NAMESPACE} exec ctacli -- cta storageclass add \ - --instance ${EOSINSTANCE} \ - --name ctaStorageClass \ - --numberofcopies 1 \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta archiveroute add \ - --instance ${EOSINSTANCE} \ - --storageclass ctaStorageClass \ - --copynb 1 \ - --tapepool ctasystest \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta mountpolicy add \ - --name ctasystest \ - --archivepriority 1 \ - --minarchiverequestage 1 \ - --retrievepriority 1 \ - --minretrieverequestage 1 \ - --comment "ctasystest" -kubectl --namespace ${NAMESPACE} exec ctacli -- cta requestermountrule add \ - --instance ${EOSINSTANCE} \ - --name adm \ - --mountpolicy ctasystest --comment "ctasystest" - -kubectl --namespace ${NAMESPACE} exec ctacli -- cta drive up ${DRIVENAMES[${driveslot}]} - -# testing -echo "EOS server version is used:" -kubectl --namespace ${NAMESPACE} exec ctaeos -- rpm -qa|grep eos-server - -# Copy test files into EOS -NB_FILES=1000 -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - echo "xrdcp /etc/group root://localhost//eos/ctaeos/cta/${TEST_FILE_NAME}" - kubectl --namespace ${NAMESPACE} exec ctaeos -- xrdcp /etc/group root://localhost//eos/ctaeos/cta/${TEST_FILE_NAME} -done - -# Wait for test files to be archived to tape -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - SECONDS_PASSED=0 - WAIT_FOR_ARCHIVED_FILE_TIMEOUT=90 - while test 0 = `kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} | awk '{print $4;}' | grep tape | wc -l`; do - echo "Waiting for file to be archived to tape: Seconds passed = ${SECONDS_PASSED}" - sleep 1 - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == ${WAIT_FOR_ARCHIVED_FILE_TIMEOUT}; then - echo "Timed out after ${WAIT_FOR_ARCHIVED_FILE_TIMEOUT} seconds waiting for file to be archived to tape" - exit 1 - fi - done - echo - echo "FILE ARCHIVED TO TAPE" -done - -# Remove the disk replicas of the test files -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - echo - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} - echo - echo "Information about the testing file:" - echo "********" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos attr ls /eos/ctaeos/cta/${TEST_FILE_NAME} - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} - echo - echo "Removing disk replica" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos file drop /eos/ctaeos/cta/${TEST_FILE_NAME} 1 -done - -# Request the test files be retrieved from tape -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - echo - echo "Information about the testing file without disk replica" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} - echo - echo - echo "trigger EOS retrieve workflow" - echo "xrdfs localhost prepare -s /eos/ctaeos/cta/${TEST_FILE_NAME}" - kubectl --namespace ${NAMESPACE} exec ctaeos -- xrdfs localhost prepare -s /eos/ctaeos/cta/${TEST_FILE_NAME} -done - -# Wait for the test files to be retrieved from tape -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - # Wait for the copy to appear on disk - SECONDS_PASSED=0 - WAIT_FOR_RETRIEVED_FILE_TIMEOUT=90 - while test 0 = `kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} | awk '{print $4;}' | grep -F "default.0" | wc -l`; do - echo "Waiting for file to be retrieved from tape: Seconds passed = ${SECONDS_PASSED}" - sleep 1 - let SECONDS_PASSED=SECONDS_PASSED+1 - - if test ${SECONDS_PASSED} == ${WAIT_FOR_RETRIEVED_FILE_TIMEOUT}; then - echo "Timed out after ${WAIT_FOR_RETRIEVED_FILE_TIMEOUT} seconds waiting for file to be retrieved from tape" - exit 1 - fi - done - echo - echo "FILE RETRIEVED FROM DISK" - echo -done - -# Display the current information about the test files -for I in `seq 1 ${NB_FILES}`; do - TEST_FILE_NAME=test_file_${I} - echo - echo "Information about the testing file:" - echo "********" - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos attr ls /eos/ctaeos/cta/${TEST_FILE_NAME} - kubectl --namespace ${NAMESPACE} exec ctaeos -- eos info /eos/ctaeos/cta/${TEST_FILE_NAME} -done - -# results -echo -#msgNum=`kubectl --namespace $NAMESPACE logs tpsrv -c taped | grep "\"File suc" | grep ${TEST_FILE_NAME} | tail -n 4|wc -l` -#if [ $msgNum == "4" ]; then -# echo "OK: all tests passed" -# rc=0 -#else -# echo "FAIL: tests failed" -# rc=1 -#fi - -echo "OK: all tests passed" -rc=0 - -rm -fr ${tempdir} - -exit $rc