MCPcopy
hub / github.com/yusing/godoxy / TestApplyLabelWithRefH2C

Function TestApplyLabelWithRefH2C

internal/route/provider/docker_test.go:267–295  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

265}
266
267func TestApplyLabelWithRefH2C(t *testing.T) {
268 entries := makeRoutes(&container.Summary{
269 Names: []string{"/netbird-server"},
270 State: "running",
271 NetworkSettings: &container.NetworkSettingsSummary{
272 Networks: map[string]*network.EndpointSettings{
273 "network": {
274 IPAddress: testDockerIP,
275 },
276 },
277 },
278 Labels: map[string]string{
279 D.LabelAliases: "netbird-api, netbird-grpc",
280 "proxy.#1.port": "80",
281 "proxy.#1.scheme": "http",
282 "proxy.#2.port": "80",
283 "proxy.#2.scheme": "h2c",
284 },
285 })
286 api, ok := entries["netbird-api"]
287 expect.True(t, ok)
288 grpc, ok := entries["netbird-grpc"]
289 expect.True(t, ok)
290
291 expect.Equal(t, api.Scheme, routeTypes.SchemeHTTP)
292 expect.Equal(t, grpc.Scheme, routeTypes.SchemeH2C)
293 expect.NoError(t, grpc.Validate())
294 expect.Equal(t, grpc.TargetURL().Scheme, "h2c")
295}
296
297func TestApplyLabelWithRefIndexError(t *testing.T) {
298 c := D.FromDocker(&container.Summary{

Callers

nothing calls this directly

Calls 3

makeRoutesFunction · 0.85
ValidateMethod · 0.65
TargetURLMethod · 0.65

Tested by

no test coverage detected