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

Function TestX509RoundtripUsingDomain

rest/x509_test.go:51–67  ·  view source on GitHub ↗

TestX509RoundtripUsingDomain 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 a domain name which is also present in the node cert.

(t *testing.T)

Source from the content-addressed store, hash-verified

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.
51func TestX509RoundtripUsingDomain(t *testing.T) {
52 base.SetUpTestLogging(t, base.LevelDebug, base.KeyAll)
53
54 ctx := base.TestCtx(t)
55 tb, _, _, _ := setupX509Tests(t, false)
56 defer tb.Close(ctx)
57
58 rt := NewRestTester(t, &RestTesterConfig{CustomTestBucket: tb, useTLSServer: true})
59 defer rt.Close()
60
61 // write a doc to ensure bucket ops work
62 tr := rt.SendAdminRequest(http.MethodPut, "/db/"+t.Name(), `{"sgwrite":true}`)
63 RequireStatus(t, tr, http.StatusCreated)
64
65 // wait for doc to come back over DCP
66 rt.WaitForDoc(t.Name())
67}
68
69func TestX509UnknownAuthorityWrap(t *testing.T) {
70 base.SetUpTestLogging(t, base.LevelDebug, base.KeyAll)

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