s3proxytest

package
v0.0.0-...-80493da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	URLExpiration      = 15 * time.Minute
	ServerAPIKey       = "3f300bdc-0028-11e8-ba89-0ed5f89f718b"
	MinioBackendConfig = backend.S3BackendConfig{
		Host:             "minio:9000",
		Region:           "eu-west-1",
		AccessKey:        "AKIAIOSFODNN7EXAMPLE",
		SecretKey:        "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
		DisableSSL:       true,
		S3ForcePathStyle: true,
	}
)

Functions

func CatchPanic

func CatchPanic()

func RunSimpleScenarioForS3proxy

func RunSimpleScenarioForS3proxy(t *testing.T, s3proxyHost string)

Used for integration and end-to-end test with the following scenario : 1- Get a presigned url for upload 1- Upload the file 2- Get a presgined url for download 2- Download the file uploaded in the step before 3- Check if the files are identical (checksum MD5) 4- Delete the file 5- Try to download the file again => should get 404 6- Batch delete files

func ServeBulkDeleteObject

func ServeBulkDeleteObject(t *testing.T, r *gin.Engine, bucket string, keys []string, authorization string) *httptest.ResponseRecorder

func ServeCopyObject

func ServeCopyObject(t *testing.T, r *gin.Engine, sourceBucket string, sourceKey string, destinationBucket string, destinationKey string, authorization string) *httptest.ResponseRecorder

func ServeCreatePresignedURLForDownload

func ServeCreatePresignedURLForDownload(t *testing.T, r *gin.Engine, bucket string, key string, authorization string) *httptest.ResponseRecorder

func ServeCreatePresignedURLForUpload

func ServeCreatePresignedURLForUpload(t *testing.T, r *gin.Engine, bucket string, key string, authorization string) *httptest.ResponseRecorder

func ServeDeleteObject

func ServeDeleteObject(t *testing.T, r *gin.Engine, bucket string, key string, authorization string) *httptest.ResponseRecorder

func ServeHTTP

func ServeHTTP(t *testing.T, r *gin.Engine, method string, url string, authorization string) *httptest.ResponseRecorder

func ServeHTTPWithBody

func ServeHTTPWithBody(t *testing.T, r *gin.Engine, method string, url string, body io.Reader, bodySize int, authorization string) *httptest.ResponseRecorder

func WaitForBucket

func WaitForBucket(t *testing.T, bucketName string, config backend.S3BackendConfig)

WaitForBucket is waiting for minio is up and bucket has been created

func WaitForRessources

func WaitForRessources(t *testing.T, s3proxyHost string)

Wait for bucket creation and s3proxy readiness

func WaitForS3proxy

func WaitForS3proxy(t *testing.T, s3proxyHost string)

Wait for s3proxy readiness

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL