Commit 2c3bd119 authored by Cedric CAFFY's avatar Cedric CAFFY Committed by Eric Cano
Browse files

Added a CI repack test job

parent 7a52a8a8
......@@ -168,7 +168,23 @@ archiveretrieve:
tags:
- kubernetes
- mhvtl
repack:
except:
- tags
stage: test
retry: 1
script:
- export NAMESPACE="repack-${CTA_BUILD_ID}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)"
- cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s tests/repack.sh -O -D -t 2400
artifacts:
when: always
expire_in: 30 days
paths:
- pod_logs
tags:
- kubernetes
- mhvtl
nightly1:
stage: shouldfail
......
......@@ -244,6 +244,7 @@ fi # DONOTARCHIVE
if [[ $ARCHIVEONLY == 1 ]]; then
echo "Archiveonly mode: exiting"
test -z $TAILPID || kill ${TAILPID} &> /dev/null
exit 0
fi
......
#!/bin/bash
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
NB_FILES=500
FILE_SIZE_KB=15
echo
echo "Launching client_ar.sh on client pod"
echo " Archiving ${NB_FILES} files of ${FILE_SIZE_KB}kB each"
echo " Archiving files: xrdcp as user1"
kubectl -n ${NAMESPACE} cp client_ar.sh client:/root/client_ar.sh
kubectl -n ${NAMESPACE} exec client -- bash /root/client_ar.sh -n ${NB_FILES} -s ${FILE_SIZE_KB} -p 100 -d /eos/ctaeos/preprod -v -A || exit 1
#kubectl -n ${NAMESPACE} exec ctaeos -- bash /root/grep_xrdlog_mgm_for_error.sh || exit 1
source ./repack_helper.sh
vidToRepack1=$(getFirstVidContainingFiles)
if [ "$vidToRepack1" != "null" ]
then
echo
echo "Launching a repack on tape $vidToRepack1"
echo
writeTapeSummary $vidToRepack1
executeRepack $vidToRepack1
echo
echo "Reclaiming tape $vidToRepack1"
executeReclaim $vidToRepack1
echo
writeTapeSummary $vidToRepack1
else
echo "No vid found to repack"
exit 1
fi
vidDestination=$(getFirstVidContainingFiles)
writeTapeSummary $vidDestination
\ No newline at end of file
......@@ -32,7 +32,7 @@ executeReclaim() {
echo "Tape $1 reclaimed"
}
getVidToRepack() {
getFirstVidContainingFiles() {
vidToRepack=$(kubectl -n ${NAMESPACE} exec ctacli -ti -- cta-admin --json ta ls --all | jq -r '[.[] | select(.occupancy != "0") | select(.lastFseq != 0) | .vid] | .[0]')
echo $vidToRepack
}
......
......@@ -31,7 +31,7 @@ source ./repack_helper.sh
echo "Execution of simple_repack.sh"
vidToRepack1=$(getVidToRepack)
vidToRepack1=$(getFirstVidContainingFiles)
if [ "$vidToRepack1" != "null" ]
then
echo
......@@ -47,7 +47,7 @@ else
exit 1
fi
vidToRepack2=$(getVidToRepack)
vidToRepack2=$(getFirstVidContainingFiles)
if [ "$vidToRepack2" != "null" ]
then
echo
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment