rest: Add test for external server

This commit is contained in:
Alexander Neumann 2018-01-20 10:25:47 +01:00
parent 67da240068
commit 2130897ce0

View file

@ -121,6 +121,25 @@ func TestBackendREST(t *testing.T) {
newTestSuite(ctx, t, serverURL, false).RunTests(t)
}
func TestBackendRESTExternalServer(t *testing.T) {
repostr := os.Getenv("RESTIC_TEST_REST_REPOSITORY")
if repostr == "" {
t.Skipf("environment variable %v not set", "RESTIC_TEST_REST_REPOSITORY")
}
cfg, err := rest.ParseConfig(repostr)
if err != nil {
t.Fatal(err)
}
c := cfg.(rest.Config)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
newTestSuite(ctx, t, c.URL, true).RunTests(t)
}
func BenchmarkBackendREST(t *testing.B) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()