File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed
Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ source _unit-test/_test_setup.sh
4+ source install/dc-detect-version.sh
5+ source install/create-docker-volumes.sh
6+
7+ start_service_and_wait_ready seaweedfs
8+
9+ $dcx seaweedfs apk add --no-cache s3cmd
10+ s3cmd=" $dc exec seaweedfs s3cmd"
11+
12+ # Create multiple buckets for testing
13+ buckets=(bucket1 bucket2 bucket3)
14+ for bucket in " ${buckets[@]} " ; do
15+ $s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket=' localhost:8333/%(bucket)' mb s3://$bucket
16+ done
17+
18+ # Verify that all buckets were created successfully
19+ bucket_list=$( $s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket=' localhost:8333/%(bucket)' ls)
20+ for bucket in " ${buckets[@]} " ; do
21+ if ! echo " $bucket_list " | grep -q " s3://$bucket " ; then
22+ echo " Error: Bucket s3://$bucket was not created successfully."
23+ exit 1
24+ fi
25+ done
26+
27+ # Can find "bucket2"
28+ if ! echo " $bucket_list " | grep -q " s3://bucket2" ; then
29+ echo " Error: Bucket s3://bucket2 was not found."
30+ exit 1
31+ fi
32+
33+ # Can't find "bucket5", should not exist
34+ if echo " $bucket_list " | grep -q " s3://bucket5" ; then
35+ echo " Error: Bucket s3://bucket5 should not exist."
36+ exit 1
37+ fi
38+
39+ report_success
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ s3cmd="$dc exec seaweedfs s3cmd"
77
88bucket_list=$( $s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket=' localhost:8333/%(bucket)' ls)
99
10- if [[ $( echo " $bucket_list " | tail -1 | awk ' {print $3} ' ) != ' s3://nodestore' ]] ; then
10+ if ! echo " $bucket_list " | grep -q " s3://nodestore" ; then
1111 apply_config_changes_nodestore=0
1212 # Only touch if no existing nodestore config is found
1313 if ! grep -q " SENTRY_NODESTORE" $SENTRY_CONFIG_PY ; then
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then
1919
2020 bucket_list=$( $s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket=' localhost:8333/%(bucket)' ls)
2121
22- if [[ $( echo " $bucket_list " | tail -1 | awk ' {print $3} ' ) != ' s3://profiles' ]] ; then
22+ if ! echo " $bucket_list " | grep -q " s3://profiles" ; then
2323 apply_config_changes_profiles=0
2424 # Only touch if no existing profiles config is found
2525 if ! grep -q " filestore.profiles-backend" $SENTRY_CONFIG_YML ; then
You can’t perform that action at this time.
0 commit comments