(t *testing.T, ctx context.Context, name string, expectRunning bool)
| 915 | } |
| 916 | |
| 917 | func assertContainerRunning(t *testing.T, ctx context.Context, name string, expectRunning bool) { |
| 918 | t.Helper() |
| 919 | c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) |
| 920 | require.NoError(t, err) |
| 921 | defer c.Close() |
| 922 | |
| 923 | info, err := c.ContainerInspect(ctx, name) |
| 924 | require.NoError(t, err) |
| 925 | |
| 926 | if expectRunning { |
| 927 | assert.True(t, info.State.Running, "container should be running") |
| 928 | } else { |
| 929 | assert.False(t, info.State.Running, "container should be stopped") |
| 930 | } |
| 931 | } |
| 932 | |
| 933 | func assertContainerResources(t *testing.T, ctx context.Context, name string, expectedCPUs, expectedMemory int64) { |
| 934 | t.Helper() |
no test coverage detected
searching dependent graphs…