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

[ci] Tests gRPC insert directories in CI

parent 362ebf02
Branches
Tags
No related merge requests found
...@@ -47,36 +47,40 @@ ${EOS_CMD} mkdir -p ${EOS_PREFIX} ...@@ -47,36 +47,40 @@ ${EOS_CMD} mkdir -p ${EOS_PREFIX}
# Create directory with system-assigned file id -- should succeed # Create directory with system-assigned file id -- should succeed
echoc $LT_BLUE "Creating directory with auto-assigned file id" 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}/test_dir1 >${TMPFILE}
[ $? -eq 0 ] || error "Creating directory with auto-assigned file id failed" [ $? -eq 0 ] || error "Creating directory with auto-assigned file id failed"
json-pretty-print.sh ${TMPFILE} json-pretty-print.sh ${TMPFILE}
rm ${TMPFILE} rm ${TMPFILE}
${EOS_CMD} ls -l ${EOS_PREFIX} ${EOS_CMD} ls -l ${EOS_PREFIX}
${EOS_CMD} fileinfo ${EOS_PREFIX}/my_test_dir ${EOS_CMD} fileinfo ${EOS_PREFIX}/test_dir1
XrdSecPROTOCOL=sss ${EOS_CMD} fileinfo ${EOS_PREFIX}/my_test_dir ${EOS_CMD} -r 2 2 rmdir ${EOS_PREFIX}/test_dir1
${EOS_CMD} rmdir ${EOS_PREFIX}/my_test_dir
# Create directory with self-assigned file id -- should succeed # Create directory with self-assigned file id -- should succeed
echoc $LT_BLUE "Creating directory with self-assigned file id" 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}/test_dir2 >${TMPFILE}
[ $? -eq 0 ] || error "Creating directory with self-assigned file id failed" [ $? -eq 0 ] || error "Creating directory with self-assigned file id failed"
json-pretty-print.sh ${TMPFILE} json-pretty-print.sh ${TMPFILE}
rm ${TMPFILE} rm ${TMPFILE}
${EOS_CMD} fileinfo ${EOS_PREFIX}/my_test_dir ${EOS_CMD} fileinfo ${EOS_PREFIX}/test_dir2
# Try again -- should fail
echoc $LT_GREEN "Creating directory with the same path (should fail)"
${EOS_TEST_DIR_INJECT} --path ${CASTOR_PREFIX}/test_dir2 >/dev/null
[ $? -ne 0 ] || error "Creating directory with self-assigned file id succeeded when it should have failed"
# Try again -- should fail # Try again -- should fail
echoc $LT_GREEN "Creating directory with the same file id (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}/test_dir3 >/dev/null
[ $? -ne 0 ] || error "Creating directory with self-assigned file id succeeded when it should have failed" [ $? -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 # Remove and try again -- should succeed
echoc $LT_GREEN "Remove the directory and restart EOS to remove the tombstone" echoc $LT_GREEN "Remove the directory and tombstone"
${EOS_CMD} rmdir ${EOS_PREFIX}/my_test_dir ${EOS_CMD} rmdir ${EOS_PREFIX}/test_dir2
${EOS_CMD} ns cache drop-single-container 9876543210
echoc $LT_BLUE "Recreate the directory with self-assigned file id (should succeed this time)" 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}/test_dir2 >/dev/null
[ $? -eq 0 ] || error "Creating directory with self-assigned file id failed with error $?" [ $? -eq 0 ] || error "Creating directory with self-assigned file id failed with error $?"
${EOS_CMD} fileinfo ${EOS_PREFIX}/my_test_dir ${EOS_CMD} fileinfo ${EOS_PREFIX}/test_dir2
${EOS_CMD} -r 2 2 rmdir ${EOS_PREFIX}/test_dir2
echoc $LT_GREEN "Cleaning up: removing tombstones and removing injected directories"
${EOS_CMD} rmdir ${EOS_PREFIX}/my_test_dir 2>/dev/null
${EOS_CMD} 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.
Please register or to comment