All Docker containers through /docker
(t *testing.T)
| 123 | |
| 124 | // All Docker containers through /docker |
| 125 | func TestGetAllDockerContainers(t *testing.T) { |
| 126 | fm := framework.New(t) |
| 127 | defer fm.Cleanup() |
| 128 | |
| 129 | // Wait for the containers to show up. |
| 130 | containerID1 := fm.Docker().RunPause() |
| 131 | containerID2 := fm.Docker().RunPause() |
| 132 | waitForContainer(containerID1, fm) |
| 133 | waitForContainer(containerID2, fm) |
| 134 | |
| 135 | request := &info.ContainerInfoRequest{ |
| 136 | NumStats: 1, |
| 137 | } |
| 138 | containersInfo, err := fm.Cadvisor().Client().AllDockerContainers(request) |
| 139 | require.NoError(t, err) |
| 140 | |
| 141 | if len(containersInfo) < 2 { |
| 142 | t.Fatalf("At least 2 Docker containers should exist, received %d: %+v", len(containersInfo), containersInfo) |
| 143 | } |
| 144 | sanityCheck(containerID1, findContainer(containerID1, containersInfo, t), t) |
| 145 | sanityCheck(containerID2, findContainer(containerID2, containersInfo, t), t) |
| 146 | } |
| 147 | |
| 148 | // Check expected properties of a Docker container. |
| 149 | func TestBasicDockerContainer(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…