ECS: How to test S3 create bucket, upload object, read object, delete object, delete bucket with the s3test.sh script
요약: How to test S3 create bucket, upload object, read object, delete object, delete bucket with the s3test script.
이 문서는 다음에 적용됩니다.
이 문서는 다음에 적용되지 않습니다.
이 문서는 특정 제품과 관련이 없습니다.
모든 제품 버전이 이 문서에 나와 있는 것은 아닙니다.
지침
Before proceeding review the following related KB for s3curl to help confirm S3 functionality:
ECS: How to perform basic S3 operations using the s3curl.pl script.
1: Log in to the ECS node over SSH as root user.
2: Use vi to create the file:
/usr/share/s3curl/s3test.sh
3: Copy the following contents into the file. Make sure to modify the TARGET IPs to match those of your ECS as the script runs on whichever IPs are placed in the TARGET. Regarding the S3CURL_ID, see ECS: How to perform basic S3 operations using the s3curl.pl script.
!/bin/bash
TARGET="10.xx.xx.xx7 10.xx.xx.xx8 10.xx.xx.xx9 10.xx.xx.xx0"
S3CURL="/usr/share/s3curl/s3curl.pl"
S3CURL_ID="--id=friendlymick"
OBJECT_NAME="newfile"cat
echo "s3curl upload test" > $OBJECT_NAME
PASS="echo -e \e[32mPASSED\e[0m"
FAIL="echo -e \e[31mFAILED\e[0m"
for ip in $(echo $TARGET)
do
echo
echo "Node - $ip"
BUCKET_NAME="bucket_$(date +%d%b_%H%M)_${ip}"
echo "Bucket/Object name: $BUCKET_NAME/$OBJECT_NAME"
echo "---------------------------------------------------------"
# Test bucket creation
echo -n "Create Bucket: "
STATUS=$($S3CURL $S3CURL_ID --createBucket -- http://${ip}:9020/${BUCKET_NAME} -s -w "%{http_code}" -o /dev/null 2> /dev/null)
test ${STATUS:-0} -eq 200 && $PASS || { $FAIL; continue; }
# Upload Object
echo -n "Upload Object: "
STATUS=$($S3CURL $S3CURL_ID --put $OBJECT_NAME -- http://${ip}:9020/${BUCKET_NAME}/${OBJECT_NAME} -s -w "%{http_code}" -o /dev/null 2> /dev/null)
test ${STATUS:-0} -eq 200 && $PASS || $FAIL
# Read Object
echo -n "Read Object: "
STATUS=$($S3CURL $S3CURL_ID -- http://${ip}:9020/${BUCKET_NAME}/${OBJECT_NAME} -s 2> /dev/null)
test "$STATUS" == "s3curl upload test" && $PASS || $FAIL
# Delete Object
echo -n "Delete Object: "
STATUS=$($S3CURL $S3CURL_ID --delete -- http://${ip}:9020/${BUCKET_NAME}/${OBJECT_NAME} -s -w "%{http_code}" -o /dev/null 2> /dev/null)
test ${STATUS:-0} -eq 204 && $PASS || $FAIL
# Delete Bucket
echo -n "Delete Bucket: "
STATUS=$($S3CURL $S3CURL_ID --delete -- http://${ip}:9020/${BUCKET_NAME} -s -w "%{http_code}" -o /dev/null 2> /dev/null)
test ${STATUS:-0} -eq 204 && $PASS || $FAIL
# Verifying Deletion
echo -n "Verify Deletion of bucket: "
STATUS=$($S3CURL $S3CURL_ID -- http://${ip}:9020/${BUCKET_NAME} -s -w "%{http_code}" -o /dev/null 2> /dev/null)
test ${STATUS:-0} -eq 404 && $PASS || $FAIL
done
4: Issue the following command to run the script:
# sh s3test.sh
All tests should come back as passed. If some tests do not come back as PASSED, contact ECS Support.
provo:/usr/share/s3curl # sh s3test.sh Node - 10.xx.xx.xx7 Bucket/Object name: bucket_14Apr_1009_10.xx.xx.xx7/newfile --------------------------------------------------------- Create Bucket: PASSED Upload Object: PASSED Read Object: PASSED Delete Object: PASSED Delete Bucket: PASSED Verify Deletion of bucket: PASSED Node - 10.xx.xx.xx8 Bucket/Object name: bucket_14Apr_1009_10.xx.xx.xx8/newfile --------------------------------------------------------- Create Bucket: PASSED Upload Object: PASSED Read Object: PASSED Delete Object: PASSED Delete Bucket: PASSED Verify Deletion of bucket: PASSED Node - 10.xx.xx.xx9 Bucket/Object name: bucket_14Apr_1009_10.xx.xx.xx9/newfile --------------------------------------------------------- Create Bucket: PASSED Upload Object: PASSED Read Object: PASSED Delete Object: PASSED Delete Bucket: PASSED Verify Deletion of bucket: PASSED Node - 10.xx.xx.xx0 Bucket/Object name: bucket_14Apr_1009_10.xx.xx.xx0/newfile --------------------------------------------------------- Create Bucket: PASSED Upload Object: PASSED Read Object: PASSED Delete Object: PASSED Delete Bucket: PASSED Verify Deletion of bucket: PASSED
해당 제품
ECS Appliance Hardware Gen1 U-Series제품
ECS Appliance Hardware Gen1 U-Series, ECS Appliance Software with Encryption, ECS Appliance Software without Encryption문서 속성
문서 번호: 000023816
문서 유형: How To
마지막 수정 시간: 08 9월 2025
버전: 6
다른 Dell 사용자에게 질문에 대한 답변 찾기
지원 서비스
디바이스에 지원 서비스가 적용되는지 확인하십시오.