2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-29 13:22:43 +00:00
restic/backend/s3_test.go
2016-01-17 18:48:05 +01:00

33 lines
530 B
Go

package backend_test
import (
"os"
"testing"
"github.com/restic/restic/backend/s3"
. "github.com/restic/restic/test"
)
type deleter interface {
Delete() error
}
func TestS3Backend(t *testing.T) {
if TestS3Server == "" {
t.Skip("s3 test server not available")
}
be, err := s3.Open(s3.Config{
URL: TestS3Server,
Bucket: "restictestbucket",
KeyID: os.Getenv("AWS_ACCESS_KEY_ID"),
Secret: os.Getenv("AWS_SECRET_ACCESS_KEY"),
})
OK(t, err)
testBackend(be, t)
del := be.(deleter)
OK(t, del.Delete())
}