2015-05-15 21:53:00 +00:00
|
|
|
package backend_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2015-12-06 22:21:48 +00:00
|
|
|
"github.com/restic/restic/backend/s3"
|
2015-11-07 12:43:15 +00:00
|
|
|
. "github.com/restic/restic/test"
|
2015-05-15 21:53:00 +00:00
|
|
|
)
|
|
|
|
|
2015-12-06 22:21:48 +00:00
|
|
|
type deleter interface {
|
|
|
|
Delete() error
|
|
|
|
}
|
2015-05-15 21:53:00 +00:00
|
|
|
|
2015-12-06 22:21:48 +00:00
|
|
|
func TestS3Backend(t *testing.T) {
|
2015-12-19 16:21:45 +00:00
|
|
|
if TestS3Server == "" {
|
|
|
|
t.Skip("s3 test server not available")
|
|
|
|
}
|
|
|
|
|
|
|
|
be, err := s3.Open(TestS3Server, "restictestbucket")
|
2015-11-07 12:43:15 +00:00
|
|
|
OK(t, err)
|
|
|
|
|
2015-12-06 22:21:48 +00:00
|
|
|
testBackend(be, t)
|
|
|
|
|
|
|
|
del := be.(deleter)
|
|
|
|
OK(t, del.Delete())
|
2015-05-15 21:53:00 +00:00
|
|
|
}
|