<commit_before><commit_msg>add test script to test functionality of univMSSInterface_generic.sh<commit_after>#!/bin/bash
#
set -x
DRIVER_DIR="/var/lib/irods/iRODS/server/bin/cmd"
DRIVER="univMSSInterface_generic.sh"
LOCAL_TEST_DIR="/tmp"
REMOTE_TEST_DIR="/pnfs/grid.sara.nl/data/irods/robert_test_dir"

# create test file
echo "this is a very small testfile" > $LOCAL_TEST_DIR/test.txt

# copy file to dCache via gridftp
${DRIVER_DIR}/${DRIVER} syncToArch $LOCAL_TEST_DIR/test.txt ${REMOTE_TEST_DIR}/test.txt
echo $?

# give status of file:
${DRIVER_DIR}/${DRIVER} stat ${REMOTE_TEST_DIR}/test.txt
echo $?

# retrieve file from dCache and check if it is the same
${DRIVER_DIR}/${DRIVER} stageToCache ${REMOTE_TEST_DIR}/test.txt $LOCAL_TEST_DIR/test1.txt
echo $?
diff $LOCAL_TEST_DIR/test.txt $LOCAL_TEST_DIR/test1.txt
echo $?

# create directory and remove it again
${DRIVER_DIR}/${DRIVER} mkdir ${REMOTE_TEST_DIR}/subdir1/subdir2
echo $?
${DRIVER_DIR}/${DRIVER} stat ${REMOTE_TEST_DIR}/subdir1/subdir2
echo $?
${DRIVER_DIR}/${DRIVER} rm ${REMOTE_TEST_DIR}/subdir1/subdir2
echo $?
${DRIVER_DIR}/${DRIVER} stat ${REMOTE_TEST_DIR}/subdir1/subdir2
echo $?
${DRIVER_DIR}/${DRIVER} rm ${REMOTE_TEST_DIR}/subdir1
echo $?
${DRIVER_DIR}/${DRIVER} stat ${REMOTE_TEST_DIR}/subdir1
echo $?

# move file in dCache
${DRIVER_DIR}/${DRIVER} mv ${REMOTE_TEST_DIR}/test.txt ${REMOTE_TEST_DIR}/test1.txt
echo $?

# remove file
${DRIVER_DIR}/${DRIVER} rm ${REMOTE_TEST_DIR}/test1.txt
echo $?

# remove file again. This should fail.
${DRIVER_DIR}/${DRIVER} rm ${REMOTE_TEST_DIR}/test1.txt
echo $?
{'fraction_non_alphanumeric': 0.15418781725888325, 'fraction_numerical': 0.00951776649746193, 'mean_word_length': 6.23394495412844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6064967', 'n_tokens_mistral': 652, 'n_tokens_neox': 621, 'n_words': 119}