ECS: Sådan testes S3 oprette bucket, uploade objekt, læse objekt, slette objekt, slette bucket med s3test.sh script

Riepilogo: Sådan testes S3 oprette bucket, uploade objekt, læse objekt, slette objekt, slette bucket med S3test script.

Questo articolo si applica a Questo articolo non si applica a Questo articolo non è legato a un prodotto specifico. Non tutte le versioni del prodotto sono identificate in questo articolo.

Istruzioni

Før du fortsætter, skal du gennemgå følgende relaterede KB for s3curl for at hjælpe med at bekræfte S3-funktionalitet: 
ECS: Sådan udføres grundlæggende S3-handlinger ved hjælp af s3curl.pl scriptet.


1: Log på ECS-noden over SSH som rodbruger.

2: Brug vi til at oprette filen: 
  /usr/share/s3curl/s3test.sh

3: Kopier følgende indhold til filen. Sørg for at ændre TARGET-IP'erne, så de svarer til ECS'erne, når scriptet kører på de IP-adresser, der er placeret i TARGET. Med hensyn til S3CURL_ID, se ECS: Sådan udføres grundlæggende S3-handlinger ved hjælp af s3curl.pl scriptet.

!/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: Udsted følgende kommando for at køre scriptet:  
   # sh s3test.sh

Alle tests skal komme tilbage som bestået. Hvis nogle tests ikke returneres som BESTÅET, skal du kontakte 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

Prodotti interessati

ECS Appliance Hardware Gen1 U-Series

Prodotti

ECS Appliance Hardware Gen1 U-Series, ECS Appliance Software with Encryption, ECS Appliance Software without Encryption
Proprietà dell'articolo
Numero articolo: 000023816
Tipo di articolo: How To
Ultima modifica: 08 set 2025
Versione:  6
Trova risposta alle tue domande dagli altri utenti Dell
Support Services
Verifica che il dispositivo sia coperto dai Servizi di supporto.