MCPcopy Create free account
hub / github.com/cloudbase/garm / TestAPIBindAddress

Function TestAPIBindAddress

config/config_test.go:264–280  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

262}
263
264func TestAPIBindAddress(t *testing.T) {
265 cfg := getDefaultAPIServerConfig()
266
267 err := cfg.Validate()
268 require.Nil(t, err)
269 require.Equal(t, cfg.BindAddress(), "0.0.0.0:9998")
270
271 cfg.Bind = "::"
272 err = cfg.Validate()
273 require.Nil(t, err)
274 require.Equal(t, cfg.BindAddress(), "[::]:9998")
275
276 cfg.Bind = "1:2:3::4"
277 err = cfg.Validate()
278 require.Nil(t, err)
279 require.Equal(t, cfg.BindAddress(), "[1:2:3::4]:9998")
280}
281
282func TestDatabaseConfig(t *testing.T) {
283 dir, err := os.MkdirTemp("", "garm-config-test")

Callers

nothing calls this directly

Calls 3

BindAddressMethod · 0.80
ValidateMethod · 0.45

Tested by

no test coverage detected