ECS: s3test.sh 스크립트를 사용하여 S3 버킷 생성, 오브젝트 업로드, 오브젝트 읽기, 오브젝트 삭제, 버킷 삭제 테스트 방법

Summary: s3test 스크립트를 사용하여 S3 버킷 생성, 오브젝트 업로드, 오브젝트 읽기, 오브젝트 삭제, 버킷 삭제를 테스트하는 방법

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

계속하기 전에 S3 기능을 확인하는 데 도움이 되도록 s3curl에 대한 다음 관련 KB를 검토하십시오. 
ECS: s3curl.pl 스크립트를


사용하여 기본 S3 작업을 수행하는 방법
1: SSH를 통해 루트 사용자로 ECS 노드에 로그인합니다.

2: vi를 사용하여 파일을 생성합니다. 
  /usr/share/s3curl/s3test.sh

3: 다음 내용을 파일에 복사합니다. 스크립트가 TARGET에 배치된 IP에서 실행되므로 ECS의 IP와 일치하도록 TARGET IP를 수정 해야 합니다. S3CURL_ID 관련하여 다음을 참조하십시오. ECS: s3curl.pl 스크립트를 사용하여 기본 S3 작업을 수행하는 방법

!/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: 다음 명령을 실행하여 스크립트를 실행합니다.  
   # sh s3test.sh

모든 테스트는 통과한 것으로 나와야 합니다. 일부 테스트가 PASSED로 반환되지 않는 경우 ECS 지원 팀에 문의하십시오.

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

Affected Products

ECS Appliance Hardware Gen1 U-Series

Products

ECS Appliance Hardware Gen1 U-Series, ECS Appliance Software with Encryption, ECS Appliance Software without Encryption
Article Properties
Article Number: 000023816
Article Type: How To
Last Modified: 08 Sep 2025
Version:  6
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.