From 09720cc7285eba871aa17bd116e737722d6a65f1 Mon Sep 17 00:00:00 2001 From: Julien Leduc <julien.leduc@cern.ch> Date: Thu, 29 Jun 2017 11:42:21 +0200 Subject: [PATCH] Adding verbose option that monitors rmcd logs for tape mounts. Enable it in the CI tests. --- .../orchestration/tests/archive_retrieve.sh | 2 +- .../orchestration/tests/client_ar.sh | 22 ++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/continuousintegration/orchestration/tests/archive_retrieve.sh b/continuousintegration/orchestration/tests/archive_retrieve.sh index 33a411a7ce..6a323312b4 100755 --- a/continuousintegration/orchestration/tests/archive_retrieve.sh +++ b/continuousintegration/orchestration/tests/archive_retrieve.sh @@ -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 diff --git a/continuousintegration/orchestration/tests/client_ar.sh b/continuousintegration/orchestration/tests/client_ar.sh index 15c17171bf..243bcd1805 100644 --- a/continuousintegration/orchestration/tests/client_ar.sh +++ b/continuousintegration/orchestration/tests/client_ar.sh @@ -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 -- GitLab