MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestX509RoundtripUsingIP

Function TestX509RoundtripUsingIP

rest/x509_test.go:31–47  ·  view source on GitHub ↗

TestX509RoundtripUsingIP is a happy-path roundtrip write test for SG connecting to CBS using valid X.509 certs for authentication. The test enforces SG connects using an IP address which is also present in the node cert.

(t *testing.T)

Source from the content-addressed store, hash-verified

29// TestX509RoundtripUsingIP is a happy-path roundtrip write test for SG connecting to CBS using valid X.509 certs for authentication.
30// The test enforces SG connects using an IP address which is also present in the node cert.
31func TestX509RoundtripUsingIP(t *testing.T) {
32 base.SetUpTestLogging(t, base.LevelDebug, base.KeyAll)
33
34 ctx := base.TestCtx(t)
35 tb, _, _, _ := setupX509Tests(t, true)
36 defer tb.Close(ctx)
37
38 rt := NewRestTester(t, &RestTesterConfig{CustomTestBucket: tb, useTLSServer: true})
39 defer rt.Close()
40
41 // write a doc to ensure bucket ops work
42 tr := rt.SendAdminRequest(http.MethodPut, "/db/"+t.Name(), `{"sgwrite":true}`)
43 RequireStatus(t, tr, http.StatusCreated)
44
45 // wait for doc to come back over DCP
46 rt.WaitForDoc(t.Name())
47}
48
49// TestX509RoundtripUsingDomain is a happy-path roundtrip write test for SG connecting to CBS using valid X.509 certs for authentication.
50// The test enforces SG connects using a domain name which is also present in the node cert.

Callers

nothing calls this directly

Calls 10

CloseMethod · 0.95
SendAdminRequestMethod · 0.95
WaitForDocMethod · 0.95
SetUpTestLoggingFunction · 0.92
TestCtxFunction · 0.92
setupX509TestsFunction · 0.85
NewRestTesterFunction · 0.85
RequireStatusFunction · 0.85
CloseMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected