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))
| 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 |
| 33 | func 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 | |
| 43 | func TestCgroupNamespacesRun(t *testing.T) { |
| 44 | skip.If(t, testEnv.DaemonInfo.OSType != "linux") |
no test coverage detected
searching dependent graphs…