Enhancement: option to send HTTP over unix socket
add tests for unix socket connection switch HTTP rest-server test to use any free port allow rest-server test graceful shutdown opportunity
This commit is contained in:
parent
d1d773cfcd
commit
6e775d3787
7 changed files with 182 additions and 41 deletions
30
internal/backend/rest/rest_unix_test.go
Normal file
30
internal/backend/rest/rest_unix_test.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
//go:build !windows && go1.20
|
||||
// +build !windows,go1.20
|
||||
|
||||
package rest_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
rtest "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestBackendRESTWithUnixSocket(t *testing.T) {
|
||||
defer func() {
|
||||
if t.Skipped() {
|
||||
rtest.SkipDisallowed(t, "restic/backend/rest.TestBackendREST")
|
||||
}
|
||||
}()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
dir := rtest.TempDir(t)
|
||||
serverURL, cleanup := runRESTServer(ctx, t, path.Join(dir, "data"), fmt.Sprintf("unix:%s", path.Join(dir, "sock")))
|
||||
defer cleanup()
|
||||
|
||||
newTestSuite(serverURL, false).RunTests(t)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue