Skip to content

Commit 2b51399

Browse files
Luke McCroneLuke McCrone
Luke McCrone
authored and
Luke McCrone
committed
re-adding parameters
1 parent b387a3c commit 2b51399

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/s3_bucket_tests.sh

+13-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ create_bucket() {
99
fi
1010
local exit_code=0
1111
local error
12-
error=$(aws s3 mb s3://"$1" 2>&1) || exit_code=$?
12+
error=$(aws s3 mb s3://"$1" 2>&1 --region "$AWS_REGION" --profile "$AWS_PROFILE") || exit_code=$?
1313
if [ $exit_code -ne 0 ]; then
1414
echo "error creating bucket: $error"
1515
return 1
@@ -24,7 +24,7 @@ delete_bucket() {
2424
fi
2525
local exit_code=0
2626
local error
27-
error=$(aws s3 rb s3://"$1" 2>&1) || exit_code="$?"
27+
error=$(aws s3 rb s3://"$1" --region "$AWS_REGION" --profile "$AWS_PROFILE" 2>&1) || exit_code="$?"
2828
if [ $exit_code -ne 0 ]; then
2929
if [[ "$error" == *"The specified bucket does not exist"* ]]; then
3030
return 0
@@ -44,7 +44,7 @@ bucket_exists() {
4444
fi
4545
local exit_code=0
4646
local error
47-
error=$(aws s3 ls s3://"$1" 2>&1) || exit_code="$?"
47+
error=$(aws s3 ls s3://"$1" --region "$AWS_REGION" --profile "$AWS_PROFILE" 2>&1) || exit_code="$?"
4848
if [ $exit_code -ne 0 ]; then
4949
if [[ "$error" == *"The specified bucket does not exist"* ]] || [[ "$error" == *"Access Denied"* ]]; then
5050
return 1
@@ -86,7 +86,7 @@ object_exists() {
8686
fi
8787
local exit_code=0
8888
local error
89-
error=$(aws s3 ls s3://"$1" 2>&1) || exit_code="$?"
89+
error=$(aws s3 ls s3://"$1" --region "$AWS_REGION" --profile "$AWS_PROFILE" 2>&1) || exit_code="$?"
9090
if [ $exit_code -ne 0 ]; then
9191
if [[ "$error" == "" ]]; then
9292
return 1
@@ -105,7 +105,7 @@ put_object() {
105105
fi
106106
local exit_code=0
107107
local error
108-
error=$(aws s3 cp "$1" s3://"$2" 2>&1) || exit_code=$?
108+
error=$(aws s3 cp "$1" s3://"$2" --region "$AWS_REGION" --profile "$AWS_PROFILE" 2>&1) || exit_code=$?
109109
if [ $exit_code -ne 0 ]; then
110110
echo "error copying object to bucket: $error"
111111
return 1
@@ -140,7 +140,7 @@ delete_object() {
140140
fi
141141
local exit_code=0
142142
local error
143-
error=$(aws s3 rm s3://"$1" 2>&1) || exit_code=$?
143+
error=$(aws s3 rm s3://"$1" --region "$AWS_REGION" --profile "$AWS_PROFILE" 2>&1) || exit_code=$?
144144
if [ $exit_code -ne 0 ]; then
145145
echo "error deleting object: $error"
146146
return 1
@@ -151,7 +151,7 @@ delete_object() {
151151
list_buckets() {
152152
local exit_code=0
153153
local output
154-
output=$(aws s3 ls 2>&1) || exit_code=$?
154+
output=$(aws s3 ls --region "$AWS_REGION" --profile "$AWS_PROFILE" 2>&1) || exit_code=$?
155155
if [ $exit_code -ne 0 ]; then
156156
echo "error listing buckets: $output"
157157
return 1
@@ -173,7 +173,7 @@ list_objects() {
173173
fi
174174
local exit_code=0
175175
local output
176-
output=$(aws s3 ls s3://"$1" 2>&1) || exit_code=$?
176+
output=$(aws s3 ls s3://"$1" --region "$AWS_REGION" --profile "$AWS_PROFILE" 2>&1) || exit_code=$?
177177
if [ $exit_code -ne 0 ]; then
178178
echo "error listing objects: $output"
179179
return 1
@@ -209,7 +209,7 @@ bucket_exists_remote_and_local() {
209209

210210
@test "create_delete_bucket_test" {
211211

212-
local bucket_name="versity-gwtest-create-delete-bucket-two"
212+
local bucket_name="versity-gwtest-create-delete-bucket-test"
213213

214214
bucket_exists $bucket_name || local exist_result=$?
215215
if [[ $exist_result -eq 2 ]]; then
@@ -231,7 +231,7 @@ bucket_exists_remote_and_local() {
231231

232232
@test "put_object_test" {
233233

234-
local bucket_name="versity-gwtest-put-object-two"
234+
local bucket_name="versity-gwtest-put-object-test"
235235
local object_name="test-object"
236236

237237
bucket_exists $bucket_name || local bucket_exists=$?
@@ -267,8 +267,8 @@ bucket_exists_remote_and_local() {
267267

268268
@test "test_list_buckets" {
269269

270-
bucket_name_one="versity-gwtest-test-list-1"
271-
bucket_name_two="versity-gwtest-test-list-2"
270+
bucket_name_one="versity-gwtest-list-one"
271+
bucket_name_two="versity-gwtest-list-two"
272272

273273
bucket_exists $bucket_name_one || local bucket_exists_one=$?
274274
if [[ $bucket_exists_one -eq 2 ]]; then
@@ -304,7 +304,7 @@ bucket_exists_remote_and_local() {
304304

305305
@test test_list_objects {
306306

307-
bucket_name="versity-gwtest-list-objs"
307+
bucket_name="versity-gwtest-list-object"
308308
object_one="test-file-one"
309309
object_two="test-file-two"
310310

0 commit comments

Comments
 (0)