MCPcopy
hub / github.com/kopia/kopia / TestServer

Function TestServer

internal/server/server_test.go:40–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38)
39
40func TestServer(t *testing.T) {
41 ctx, env := repotesting.NewEnvironment(t, repotesting.FormatNotImportant)
42 apiServerInfo := servertesting.StartServer(t, env, true)
43
44 ctx2, cancel := context.WithCancel(ctx)
45
46 rep, err := servertesting.ConnectAndOpenAPIServer(t, ctx2, apiServerInfo, repo.ClientOptions{
47 Username: servertesting.TestUsername,
48 Hostname: servertesting.TestHostname,
49 }, content.CachingOptions{
50 CacheDirectory: testutil.TempDirectory(t),
51 ContentCacheSizeBytes: maxCacheSizeBytes,
52 }, servertesting.TestPassword, &repo.Options{})
53
54 // cancel immediately to ensure we did not spawn goroutines that depend on ctx inside
55 // repo.OpenAPIServer()
56 cancel()
57
58 require.NoError(t, err)
59
60 defer rep.Close(ctx)
61
62 remoteRepositoryTest(ctx, t, rep)
63 remoteRepositoryNotificationTest(t, ctx, rep, env.RepositoryWriter)
64}
65
66func TestGRPCServer_AuthenticationError(t *testing.T) {
67 ctx, env := repotesting.NewEnvironment(t, repotesting.FormatNotImportant)

Callers

nothing calls this directly

Calls 7

NewEnvironmentFunction · 0.92
StartServerFunction · 0.92
ConnectAndOpenAPIServerFunction · 0.92
TempDirectoryFunction · 0.92
remoteRepositoryTestFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected