Skip to content
Snippets Groups Projects
Commit e241deff authored by Julien Leduc's avatar Julien Leduc
Browse files

Adding verbose option that monitors rmcd logs for tape mounts.

Enable it in the CI tests.
parent e7d7bcfa
Branches
Tags
No related merge requests found
......@@ -44,6 +44,6 @@ echo " Archiving file: xrdcp as user1"
echo " Retrieving it as poweruser1"
kubectl -n ${NAMESPACE} cp client_ar.sh client:/root/client_ar.sh
kubectl -n ${NAMESPACE} cp client_helper.sh client:/root/client_helper.sh
kubectl -n ${NAMESPACE} exec client -- bash /root/client_ar.sh -n 100 -s 1 -p 4 || exit 1
kubectl -n ${NAMESPACE} exec client -- bash /root/client_ar.sh -n 100 -s 1 -p 4 -v || exit 1
exit 0
......@@ -7,15 +7,17 @@ TEST_FILE_NAME_BASE=test
NB_PROCS=1
NB_FILES=1
FILE_KB_SIZE=1
VERBOSE=0
TAILPID=''
usage() { cat <<EOF 1>&2
Usage: $0 [-n <nb_files>] [-s <file_kB_size>] [-p <# parallel procs>]
Usage: $0 [-n <nb_files>] [-s <file_kB_size>] [-p <# parallel procs>] [-v]
EOF
exit 1
}
while getopts "n:s:p:" o; do
while getopts "n:s:p:v" o; do
case "${o}" in
n)
NB_FILES=${OPTARG}
......@@ -26,6 +28,9 @@ while getopts "n:s:p:" o; do
p)
NB_PROCS=${OPTARG}
;;
v)
VERBOSE=1
;;
*)
usage
;;
......@@ -38,13 +43,16 @@ if [ ! -z "${error}" ]; then
exit 1
fi
STATUS_FILE=$(mktemp)
dd if=/dev/urandom of=/tmp/testfile bs=1k count=${FILE_KB_SIZE} || exit 1
if [[ $VERBOSE == 1 ]]; then
tail -v -f /mnt/logs/tpsrv0*/rmcd/castor/rmcd_legacy.log &
TAILPID=$!
fi
echo "Creating test dir in eos: ${EOS_DIR}"
# uuid should be unique no need to remove dir before...
# XrdSecPROTOCOL=sss eos -r 0 0 root://${EOSINSTANCE} rm -Fr ${EOS_DIR}
......@@ -121,7 +129,7 @@ while test 0 != $(grep -c tapeonly$ ${STATUS_FILE}); do
break
fi
echo "$(grep -c retrieved$ ${STATUS_FILE})/${NB_FILES} retrieved"
echo "$(grep -c retrieved$ ${STATUS_FILE})/${TAPEONLY} retrieved"
for TEST_FILE_NAME in $(grep tapeonly$ ${STATUS_FILE} | sed -e 's/ .*$//'); do
test 2 = $(eos root://${EOSINSTANCE} info ${EOS_DIR}/${TEST_FILE_NAME} | grep -c nodrain) && sed -i ${STATUS_FILE} -e "s/${TEST_FILE_NAME} tapeonly/${TEST_FILE_NAME} retrieved/"
......@@ -137,6 +145,8 @@ echo "RETRIEVED/TAPEONLY/ARCHIVED/NB_FILES"
echo "${RETRIEVED}/${TAPEONLY}/${ARCHIVED}/${NB_FILES}"
echo "###"
# stop tail
test -z $TAILPID || kill ${TAILPID}
test ${RETRIEVED} = ${NB_FILES} && exit 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment