mirror of
https://github.com/restic/restic.git
synced 2026-11-25 15:17:50 +00:00
Use local instance of minio server.
Need to figure out how to have tests automatically start and kill server.
This commit is contained in:
1 parent
e2445f4c97
commit
69a9adc4c3
3 files changed
+28
-28
No files matched your search
+19
-2
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user