MCPcopy
hub / github.com/moby/moby / testCreateFailureWithCgroupNs

Function testCreateFailureWithCgroupNs

integration/container/run_cgroupns_linux_test.go:33–41  ·  view source on GitHub ↗

Bring up a daemon with the specified default cgroup namespace mode. Create a container with the container options, expecting an error with the specified string

(ctx context.Context, t *testing.T, daemonNsMode string, errStr string, containerOpts ...func(*container.TestContainerConfig))

Source from the content-addressed store, hash-verified

31// Bring up a daemon with the specified default cgroup namespace mode. Create a container with the container options,
32// expecting an error with the specified string
33func testCreateFailureWithCgroupNs(ctx context.Context, t *testing.T, daemonNsMode string, errStr string, containerOpts ...func(*container.TestContainerConfig)) {
34 d := daemon.New(t, daemon.WithDefaultCgroupNamespaceMode(daemonNsMode))
35 apiClient := d.NewClientT(t)
36
37 d.StartWithBusybox(ctx, t, "--iptables=false", "--ip6tables=false")
38 defer d.Stop(t)
39 _, err := container.CreateFromConfig(ctx, apiClient, container.NewTestConfig(containerOpts...))
40 assert.ErrorContains(t, err, errStr)
41}
42
43func TestCgroupNamespacesRun(t *testing.T) {
44 skip.If(t, testEnv.DaemonInfo.OSType != "linux")

Callers 1

Calls 7

NewFunction · 0.92
CreateFromConfigFunction · 0.92
NewTestConfigFunction · 0.92
NewClientTMethod · 0.80
StartWithBusyboxMethod · 0.80
StopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…