forked from TrueCloudLab/restic
Use local instance of minio server.
Need to figure out how to have tests automatically start and kill server.
This commit is contained in:
parent
e2445f4c97
commit
69a9adc4c3
3 changed files with 28 additions and 28 deletions
|
@ -1,17 +1,34 @@
|
|||
package backend_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/minio/minio-go"
|
||||
bes3 "github.com/restic/restic/backend/s3"
|
||||
. "github.com/restic/restic/test"
|
||||
)
|
||||
|
||||
func TestS3Backend(t *testing.T) {
|
||||
s, err := bes3.Open("play.minio.io:9000", "restictestbucket")
|
||||
|
||||
config := minio.Config{
|
||||
AccessKeyID: os.Getenv("AWS_ACCESS_KEY_ID"),
|
||||
SecretAccessKey: os.Getenv("AWS_SECRET_ACCESS_KEY"),
|
||||
Endpoint: "http://localhost:9000",
|
||||
}
|
||||
s3Client, err := minio.New(config)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
bucketname := "restictestbucket"
|
||||
|
||||
err = s3Client.MakeBucket(bucketname, "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
s, err := bes3.Open("127.0.0.1:9000", bucketname)
|
||||
OK(t, err)
|
||||
|
||||
testBackend(s, t)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue