github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/ais/test/s3/put_object.in (about)

     1  echo "0123456789" > $OBJECT.txt
     2  s3cmd mb s3://$BUCKET --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)"
     3  ais bucket props set ais://$BUCKET checksum.type=md5
     4  
     5  #Negative Testing
     6  s3cmd put $OBJECT.txt s3://non_existent_bucket/$OBJECT --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" //FAIL ERROR: S3 error: 404 (NoSuchBucket): bucket "non_existent_bucket" does not exist
     7  s3cmd get             s3://$BUCKET$OBJECT $OBJECT_copy.txt --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" //FAIL ERROR: S3 error: 404 (ErrNotFound): t[DEfAlGwT]: ais://$BUCKET$OBJECT does not exist
     8  s3cmd rm              s3://$BUCKET$OBJECT  --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" //FAIL ERROR: S3 error: 404 (ErrNotFound): t[DEfAlGwT]: ais://$BUCKET$OBJECT does not exist
     9  s3cmd info            s3://$BUCKET$OBJECT --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" //FAIL ERROR: S3 error: 400 (Bad Request)
    10  
    11  #Positive Testing
    12  s3cmd put $OBJECT.txt s3://$BUCKET/$OBJECT --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" // IGNORE
    13  s3cmd ls              s3://$BUCKET --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" | wc -l
    14  s3cmd get             s3://$BUCKET$OBJECT $OBJECT_copy.txt --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" // IGNORE
    15  s3cmd info            s3://$BUCKET$OBJECT --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" | grep -v "Last mod"
    16  cat $OBJECT_copy.txt
    17  echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit." > $OBJECT_new.txt
    18  s3cmd put $OBJECT_new.txt s3://$BUCKET/$OBJECT --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" // IGNORE
    19  s3cmd get             s3://$BUCKET$OBJECT $OBJECT_new_copy.txt --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)" // IGNORE
    20  cat $OBJECT_new_copy.txt
    21  rm $OBJECT.txt $OBJECT_copy.txt $OBJECT_new.txt $OBJECT_new_copy.txt // IGNORE
    22  s3cmd rm s3://$BUCKET$OBJECT  --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)"  // IGNORE
    23  s3cmd rb s3://$BUCKET --host=$HOST $PARAMS --host-bucket="$HOST/%(bucket)"