mirror of
https://github.com/buckit-io/buckit.git
synced 2026-09-21 01:53:31 +00:00
01ecad1ea9
- Rename all 'minio server' references to './buckit server' - Update default credentials from minioadmin to buckitadmin - Add 'pkill -9 buckit' to all test cleanup functions - Pin workflow Go version to 1.25.10 - Update vulnerable Go modules - Fix resiliency tests: restore docker compose --wait, add MC_HOST_local env var, fix induce_bitrot_for_xlmeta typo - Update mint docker-compose images to buckit - Update IAM integration and root lockdown test scripts
48 lines
1.5 KiB
Bash
Executable File
48 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
echo "script failed" >resiliency-verify.log # assume initial state
|
|
|
|
ALIAS_NAME=myminio
|
|
BUCKET="test-bucket"
|
|
SRC_DIR="/tmp/data"
|
|
DEST_DIR="/tmp/dest"
|
|
|
|
./mc admin config set "$ALIAS_NAME" api requests_max=400
|
|
|
|
OBJ_COUNT_AFTER_STOP=$(./mc ls "${ALIAS_NAME}"/"${BUCKET}"/initial-data/ | wc -l)
|
|
# Count should match the initial count of 10
|
|
if [ "${OBJ_COUNT_AFTER_STOP}" -ne 10 ]; then
|
|
echo "Expected 10 objects; received ${OBJ_COUNT_AFTER_STOP}"
|
|
exit 1
|
|
fi
|
|
|
|
OUT=$(./mc cp --quiet "${SRC_DIR}"/* "${ALIAS_NAME}"/"${BUCKET}"/new-data/)
|
|
RET=${?}
|
|
if [ ${RET} -ne 0 ]; then
|
|
echo "Error copying objects to new prefix: ${OUT}"
|
|
exit 1
|
|
fi
|
|
|
|
OBJ_COUNT_AFTER_COPY=$(./mc ls "${ALIAS_NAME}"/"${BUCKET}"/new-data/ | wc -l)
|
|
if [ "${OBJ_COUNT_AFTER_COPY}" -ne "${OBJ_COUNT_AFTER_STOP}" ]; then
|
|
echo "Expected ${OBJ_COUNT_AFTER_STOP} objects; received ${OBJ_COUNT_AFTER_COPY}"
|
|
exit 1
|
|
fi
|
|
|
|
OUT=$(./mc cp --quiet --recursive "${ALIAS_NAME}"/"${BUCKET}"/new-data/ "${DEST_DIR}"/)
|
|
RET=${?}
|
|
if [ ${RET} -ne 0 ]; then
|
|
echo "Get objects failed: ${OUT}"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if check sums match for source and destination directories
|
|
CHECK_SUM_SRC=$(sha384sum <(sha384sum "${SRC_DIR}"/* | cut -d " " -f 1 | sort) | cut -d " " -f 1)
|
|
CHECK_SUM_DEST=$(sha384sum <(sha384sum "${DEST_DIR}"/* | cut -d " " -f 1 | sort) | cut -d " " -f 1)
|
|
if [ "${CHECK_SUM_SRC}" != "${CHECK_SUM_DEST}" ]; then
|
|
echo "Checksum verification of source files and destination files failed"
|
|
exit 1
|
|
fi
|
|
|
|
echo "script passed" >resiliency-verify.log
|