TestBasicContainerdContainer tests basic container properties.
(t *testing.T)
| 173 | |
| 174 | // TestBasicContainerdContainer tests basic container properties. |
| 175 | func TestBasicContainerdContainer(t *testing.T) { |
| 176 | fm := framework.New(t) |
| 177 | defer fm.Cleanup() |
| 178 | |
| 179 | containerID := fm.Containerd().RunPause() |
| 180 | |
| 181 | // Wait for the container to show up |
| 182 | waitForContainerdContainer(containerID, fm) |
| 183 | |
| 184 | // Query all containers via SubcontainersInfo |
| 185 | allInfo, err := fm.Cadvisor().Client().SubcontainersInfo("/", &info.ContainerInfoRequest{ |
| 186 | NumStats: 1, |
| 187 | }) |
| 188 | require.NoError(t, err) |
| 189 | |
| 190 | // Find our container |
| 191 | containerInfo := findContainerdContainer(containerID, allInfo) |
| 192 | require.NotNil(t, containerInfo, "Container %q should be found", containerID) |
| 193 | assert.NotEmpty(t, containerInfo.Stats, "Should have at least one stat") |
| 194 | } |
| 195 | |
| 196 | // TestContainerdContainerCpuStats tests CPU statistics collection for containerd containers. |
| 197 | func TestContainerdContainerCpuStats(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…