Skip to content

Commit

Permalink
test: remove some skips
Browse files Browse the repository at this point in the history
  • Loading branch information
lrm25 committed Jan 3, 2025
1 parent 198c16b commit ed15dfb
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 24 deletions.
16 changes: 8 additions & 8 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/env.sh
source ./tests/report.sh
source ./tests/setup_mc.sh
Expand Down Expand Up @@ -68,11 +65,14 @@ delete_temp_log_if_exists() {
# bats teardown function
teardown() {
# shellcheck disable=SC2154
if ! bucket_cleanup_if_bucket_exists "s3api" "$BUCKET_ONE_NAME"; then
log 3 "error deleting bucket $BUCKET_ONE_NAME or contents"
fi
if ! bucket_cleanup_if_bucket_exists "s3api" "$BUCKET_TWO_NAME"; then
log 3 "error deleting bucket $BUCKET_TWO_NAME or contents"
if [ "$DELETE_BUCKETS_AFTER_TEST" != "false" ]; then
log 5 "deleting or clearing buckets"
if ! bucket_cleanup_if_bucket_exists "s3api" "$BUCKET_ONE_NAME"; then
log 3 "error deleting bucket $BUCKET_ONE_NAME or contents"
fi
if ! bucket_cleanup_if_bucket_exists "s3api" "$BUCKET_TWO_NAME"; then
log 3 "error deleting bucket $BUCKET_TWO_NAME or contents"
fi
fi
if user_exists "$USERNAME_ONE" && ! delete_user "$USERNAME_ONE"; then
log 3 "error deleting user $USERNAME_ONE"
Expand Down
14 changes: 8 additions & 6 deletions tests/teardown_static.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Copyright 2024 Versity Software
# This file is licensed under the Apache License, Version 2.0
Expand All @@ -21,12 +21,14 @@ if ! base_setup; then
log 2 "error starting versity to set up static buckets"
exit 1
fi
if ! delete_bucket_recursive "s3" "$BUCKET_ONE_NAME"; then
log 2 "error creating static bucket one"
elif ! delete_bucket_recursive "s3" "$BUCKET_TWO_NAME"; then
log 2 "error creating static bucket two"
#if ! delete_bucket_recursive "s3api" "$BUCKET_ONE_NAME"; then
if ! clear_bucket_s3api "$BUCKET_ONE_NAME"; then
log 2 "error deleting static bucket one"
elif ! delete_bucket_recursive "s3api" "$BUCKET_TWO_NAME"; then
log 2 "error deleting static bucket two"
else
log 4 "buckets deleted successfully"
fi
log 4 "buckets deleted successfully"
if ! stop_versity; then
log 2 "error stopping versity"
fi
3 changes: 3 additions & 0 deletions tests/test_mc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/test_common.sh
source ./tests/setup.sh
source ./tests/util/util_create_bucket.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/test_mc_file_count.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/test_common.sh

export RUN_MC=true
Expand Down
6 changes: 3 additions & 3 deletions tests/test_rest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/commands/create_multipart_upload.sh
source ./tests/commands/delete_object_tagging.sh
source ./tests/commands/get_bucket_versioning.sh
Expand Down Expand Up @@ -383,9 +386,6 @@ export RUN_USERS=true
}

@test "REST - bucket tagging - tags" {
if [ "$DIRECT" != "true" ]; then
skip "https://github.com/versity/versitygw/issues/932"
fi
test_key="testKey"
test_value="testValue"

Expand Down
6 changes: 3 additions & 3 deletions tests/test_rest_acl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/commands/put_object.sh
source ./tests/logger.sh
source ./tests/setup.sh
Expand All @@ -23,9 +26,6 @@ source ./tests/util/util_acl.sh
export RUN_USERS=true

@test "REST - get ACL" {
if [ "$DIRECT" != "true" ]; then
skip "https://github.com/versity/versitygw/issues/971"
fi
run setup_bucket "s3api" "$BUCKET_ONE_NAME"
assert_success

Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/test_common.sh
source ./tests/util/util_file.sh

Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3_file_count.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/test_common.sh
source ./tests/util/util_file.sh

Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3api_bucket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/setup.sh
source ./tests/util/util.sh
source ./tests/util/util_create_bucket.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3api_multipart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/setup.sh
source ./tests/test_s3api_root_inner.sh
source ./tests/util/util_file.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3api_object.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/setup.sh
source ./tests/util/util.sh
source ./tests/util/util_create_bucket.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3api_policy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/logger.sh
source ./tests/setup.sh
source ./tests/test_s3api_policy_bucket.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/setup.sh
source ./tests/test_common.sh
source ./tests/test_common_acl.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3cmd_file_count.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/test_common.sh

export RUN_S3CMD=true
Expand Down
3 changes: 3 additions & 0 deletions tests/test_user_aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/test_user_common.sh
source ./tests/util/util_users.sh
source ./tests/commands/get_object.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/test_user_s3cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# specific language governing permissions and limitations
# under the License.

load ./bats-support/load
load ./bats-assert/load

source ./tests/test_user_common.sh

export RUN_S3CMD=true
Expand Down
4 changes: 0 additions & 4 deletions tests/util/util_bucket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ bucket_cleanup_if_bucket_exists() {
fi

if [ "$3" == "true" ] || bucket_exists "$1" "$2"; then
if [ "$DELETE_BUCKETS_AFTER_TEST" == "false" ]; then
log 2 "skipping bucket cleanup/deletion"
return 0
fi
if ! bucket_cleanup "$1" "$2"; then
log 2 "error deleting bucket and/or contents"
return 1
Expand Down

0 comments on commit ed15dfb

Please sign in to comment.