Skip to content
Snippets Groups Projects
Commit 7f8622ab authored by Michael Davis's avatar Michael Davis
Browse files

[ci] Adds configuration for migration tools

parent dd515e58
No related branches found
Tags help list
No related merge requests found
Pipeline #32517 failed
......@@ -17,7 +17,7 @@ if [ ! -e /etc/buildtreeRunner ]; then
yum-config-manager --enable ceph
# install needed packages
yum -y install cta-objectstore-tools cta-doc mt-st mtx lsscsi sg3_utils cta-catalogueutils ceph-common oracle-instantclient-sqlplus
yum -y install cta-objectstore-tools cta-doc mt-st mtx lsscsi sg3_utils cta-catalogueutils ceph-common oracle-instantclient-sqlplus cta-migration-tools
yum clean packages
fi
......@@ -26,6 +26,9 @@ echo "Using this configuration for library:"
cat /tmp/library-rc.sh
. /tmp/library-rc.sh
echo "Configuring migration tools:"
/opt/run/bin/init_migration_tools.sh
echo "Configuring objectstore:"
/opt/run/bin/init_objectstore.sh
. /tmp/objectstore-rc.sh
......@@ -50,7 +53,6 @@ else
echo "Reusing objectstore (no check)"
fi
echo "Configuring database:"
/opt/run/bin/init_database.sh
. /tmp/database-rc.sh
......
#!/bin/bash
cat <<EOF
castor.db_login oracle:castor/<password>@castor
castor.json true
castor.max_num_connections 1
castor.batch_size 100
castor.prefix /castor/cern.ch
eos.dry_run false
eos.prefix /eos/grpc
eos.endpoint eoscta:50051
eos.token migrationtesttoken
EOF
exit 0
......@@ -24,8 +24,8 @@ echoc()
echo -e "${COLOUR}$*${NC}"
}
TEST_PATH=$(which eos-test-dir-inject)
[ -x ${TEST_PATH} ] || error "Can't find executable eos-test-dir-inject"
EOS_TEST_DIR_INJECT=/usr/bin/eos-test-dir-inject
[ -x ${EOS_TEST_DIR_INJECT} ] || error "Can't find executable ${EOS_TEST_DIR_INJECT}"
CONFIG_FILE=/etc/cta/castor-migration.conf
[ -r ${CONFIG_FILE} ] || error "Can't find configuration file ${CONFIG_FILE}"
......@@ -41,7 +41,7 @@ eos mkdir -p ${EOS_PREFIX} 2>/dev/null
# 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}/my_test_dir >${TMPFILE}
${EOS_TEST_DIR_INJECT} --path ${CASTOR_PREFIX}/my_test_dir >${TMPFILE}
[ $? -eq 0 ] || error "Creating directory with auto-assigned file id failed"
json-pretty-print.sh ${TMPFILE}
rm ${TMPFILE}
......@@ -51,7 +51,7 @@ eos rmdir ${EOS_PREFIX}/my_test_dir
# Create directory with self-assigned file id -- should succeed
echoc $LT_BLUE "Creating directory with self-assigned file id"
eos-test-dir-inject --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir >${TMPFILE}
${EOS_TEST_DIR_INJECT} --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir >${TMPFILE}
[ $? -eq 0 ] || error "Creating directory with self-assigned file id failed"
json-pretty-print.sh ${TMPFILE}
rm ${TMPFILE}
......@@ -59,18 +59,17 @@ eos fileinfo ${EOS_PREFIX}/my_test_dir
# Try again -- should fail
echoc $LT_GREEN "Creating directory with the same file id (should fail)"
eos-test-dir-inject --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir2 >/dev/null
${EOS_TEST_DIR_INJECT} --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir2 >/dev/null
[ $? -ne 0 ] || error "Creating directory with self-assigned file id succeeded when it should have failed"
# Remove and try again -- should succeed after restarting EOS
echoc $LT_GREEN "Remove the directory and restart EOS to remove the tombstone"
eos rmdir ${EOS_PREFIX}/my_test_dir
echoc $LT_BLUE "Recreate the directory with self-assigned file id (should succeed this time)"
eos-test-dir-inject --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir >/dev/null
${EOS_TEST_DIR_INJECT} --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir >/dev/null
[ $? -eq 0 ] || error "Creating directory with self-assigned file id failed with error $?"
eos fileinfo ${EOS_PREFIX}/my_test_dir
echoc $LT_GREEN "Cleaning up: removing tombstones and removing injected directories"
eos rmdir ${EOS_PREFIX}/my_test_dir 2>/dev/null
eos rmdir ${EOS_PREFIX}/my_test_dir2 2>/dev/null
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment