storj/scripts/test-captplanet.sh
Natalie Villasana ff65663867
adds Bucket Store (#213)
* adds foundation for bucketStore

* adds prefixedObjStore to buckets package, adjusts gateway-storj accordingly

* fixes multi value assignment problems in gateway-storj

* fixes more multi value assignment errors in gateway-storj

* starts changing miniogw tests to accommodate buckets

* creates bucket store mock

* wip - fixing test cases in object tests

* adds get, put, and list object tests, comments out two test cases

* adds happy scenario tests for bucket methods

* fixes bug in list, removes redundant parts from gateway tests

* fixes nit

* Clean up tests from #188

* Fix bug with timestamp conversion in segment store

* fixes segments.Meta test

* Fix regression in listing objects in a bucket

* adds check to see if bucket is empty before deleting

* updates DeleteBucket test to account for empty/full bucket

* adds TODOs for DeleteBucket and MakeBucket for some cases, adjusts tests, filters out minio errors in logging.go

* adds checks for if buckets already exist or not in DeleteBucket and MakeBucket functions; adjusts tests

* adds BucketNotFound error check in bucket store, removes todo

* adds make_bucket to Travis test, updates boltdb client constructor to always create a bucket (table)
2018-08-16 10:32:28 -04:00

44 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
go install -v storj.io/storj/cmd/captplanet
captplanet setup
captplanet run &
CAPT_PID=$!
aws configure set aws_access_key_id insecure-dev-access-key
aws configure set aws_secret_access_key insecure-dev-secret-key
aws configure set default.region us-east-1
aws configure set default.s3.multipart_threshold 1TB
head -c 1024 </dev/urandom > ./small-upload-testfile # create 1mb file of random bytes (inline)
head -c 5120 </dev/urandom > ./big-upload-testfile # create 5mb file of random bytes (remote)
aws s3 --endpoint=http://localhost:7777/ mb s3://bucket
aws s3 --endpoint=http://localhost:7777/ cp ./small-upload-testfile s3://bucket/small-testfile
aws s3 --endpoint=http://localhost:7777/ cp ./big-upload-testfile s3://bucket/big-testfile
aws s3 --endpoint=http://localhost:7777/ ls s3://bucket
aws s3 --endpoint=http://localhost:7777/ cp s3://bucket/small-testfile ./small-download-testfile
aws s3 --endpoint=http://localhost:7777/ cp s3://bucket/big-testfile ./big-download-testfile
if cmp ./small-upload-testfile ./small-download-testfile
then
echo "Downloaded file matches uploaded file";
else
echo "Downloaded file does not match uploaded file";
kill -9 $CAPT_PID
exit 1;
fi
if cmp ./big-upload-testfile ./big-download-testfile
then
echo "Downloaded file matches uploaded file";
else
echo "Downloaded file does not match uploaded file";
kill -9 $CAPT_PID
exit 1;
fi
kill -9 $CAPT_PID