MCPcopy
hub / github.com/etcd-io/etcd / assertAuthority

Function assertAuthority

tests/integration/grpc_test.go:162–181  ·  view source on GitHub ↗
(t *testing.T, expectedAuthorityPattern string, clus *integration.Cluster, filterMethod string)

Source from the content-addressed store, hash-verified

160}
161
162func assertAuthority(t *testing.T, expectedAuthorityPattern string, clus *integration.Cluster, filterMethod string) {
163 t.Helper()
164 for _, m := range clus.Members {
165 requestsFound := 0
166 expectedAuthority := templateAuthority(t, expectedAuthorityPattern, m)
167 for _, r := range m.RecordedRequests() {
168 if filterMethod != "" && r.FullMethod != filterMethod {
169 continue
170 }
171 if r.Authority == expectedAuthority {
172 requestsFound++
173 } else {
174 t.Errorf("Got unexpected authority header, member: %q, request: %q, got authority: %q, expected %q", m.Name, r.FullMethod, r.Authority, expectedAuthority)
175 }
176 }
177 if requestsFound == 0 {
178 t.Errorf("Expect at least one request with matched authority header value was recorded by the server intercepter on member %s but got 0", m.Name)
179 }
180 }
181}

Callers 1

TestAuthorityFunction · 0.70

Calls 4

templateAuthorityFunction · 0.85
HelperMethod · 0.65
ErrorfMethod · 0.65
RecordedRequestsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…