forked from TrueCloudLab/distribution
Add s3 driver for the new Storage Layer API
This commit is contained in:
parent
47ca8be42f
commit
1342873367
3 changed files with 343 additions and 0 deletions
29
storagedriver/s3/s3_test.go
Normal file
29
storagedriver/s3/s3_test.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package s3
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/crowdmob/goamz/aws"
|
||||
"github.com/docker/docker-registry/storagedriver"
|
||||
"github.com/docker/docker-registry/storagedriver/testsuites"
|
||||
. "gopkg.in/check.v1"
|
||||
)
|
||||
|
||||
// Hook up gocheck into the "go test" runner.
|
||||
func Test(t *testing.T) { TestingT(t) }
|
||||
|
||||
func init() {
|
||||
accessKey := os.Getenv("ACCESS_KEY")
|
||||
secretKey := os.Getenv("SECRET_KEY")
|
||||
region := os.Getenv("AWS_REGION")
|
||||
bucket := os.Getenv("S3_BUCKET")
|
||||
encrypt := os.Getenv("S3_ENCRYPT")
|
||||
|
||||
s3DriverConstructor := func() (storagedriver.StorageDriver, error) {
|
||||
return NewDriver(accessKey, secretKey, aws.GetRegion(region), true, bucket)
|
||||
}
|
||||
|
||||
testsuites.RegisterInProcessSuite(s3DriverConstructor)
|
||||
testsuites.RegisterIPCSuite("s3", map[string]string{"accessKey": accessKey, "secretKey": secretKey, "region": region, "bucket": bucket, "encrypt": encrypt})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue