WaitForCVMDocker waits for the inner container docker daemon to spin up.
(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource, timeout time.Duration)
| 193 | |
| 194 | // WaitForCVMDocker waits for the inner container docker daemon to spin up. |
| 195 | func WaitForCVMDocker(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource, timeout time.Duration) { |
| 196 | t.Helper() |
| 197 | |
| 198 | ctx, cancel := context.WithTimeout(context.Background(), timeout) |
| 199 | defer cancel() |
| 200 | |
| 201 | for r := retry.New(time.Second, time.Second); r.Wait(ctx); { |
| 202 | _, err := ExecInnerContainer(t, pool, ExecConfig{ |
| 203 | ContainerID: resource.Container.ID, |
| 204 | Cmd: []string{"docker", "info"}, |
| 205 | }) |
| 206 | if err == nil { |
| 207 | break |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | // waitForCVM waits for the inner container to spin up. |
| 213 | func waitForCVM(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource) bool { |