f3e62199ea
This function is called by `daemon.containerCreate()` which is already wrapping errors coming from `verifyNetworkingConfig()` with `errdefs.InvalidParameter()`. So `verifyNetworkingConfig()` should only return standard errors. Signed-off-by: Albin Kerouanton <albinker@gmail.com>
21 lines
608 B
Go
21 lines
608 B
Go
package daemon // import "github.com/docker/docker/daemon"
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/docker/docker/api/types/network"
|
|
"gotest.tools/v3/assert"
|
|
is "gotest.tools/v3/assert/cmp"
|
|
)
|
|
|
|
// Test case for 35752
|
|
func TestVerifyNetworkingConfig(t *testing.T) {
|
|
name := "mynet"
|
|
endpoints := make(map[string]*network.EndpointSettings, 1)
|
|
endpoints[name] = nil
|
|
nwConfig := &network.NetworkingConfig{
|
|
EndpointsConfig: endpoints,
|
|
}
|
|
err := verifyNetworkingConfig(nwConfig)
|
|
assert.Check(t, is.Error(err, "no EndpointSettings for mynet"), "should produce an error because no EndpointSettings were passed")
|
|
}
|