Update test based on new PullImage CRI.

Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
This commit is contained in:
Haiyan Meng
2019-02-26 12:19:01 -08:00
parent fd44b9a5d0
commit 035ce6c975
10 changed files with 20 additions and 16 deletions

View File

@@ -133,7 +133,7 @@ func TestContainerdRestart(t *testing.T) {
t.Logf("Pull test images")
for _, image := range []string{"busybox", "alpine"} {
img, err := imageService.PullImage(&runtime.ImageSpec{image}, nil)
img, err := imageService.PullImage(&runtime.ImageSpec{image}, nil, nil)
require.NoError(t, err)
defer func() {
assert.NoError(t, imageService.RemoveImage(&runtime.ImageSpec{Image: img}))
@@ -209,15 +209,16 @@ func TestUnknownStateAfterContainerdRestart(t *testing.T) {
t.Skip("unsupported config: runc not in PATH")
}
sbConfig := PodSandboxConfig("sandbox", "sandbox-unknown-state")
const testImage = "busybox"
t.Logf("Pull test image %q", testImage)
img, err := imageService.PullImage(&runtime.ImageSpec{Image: testImage}, nil)
img, err := imageService.PullImage(&runtime.ImageSpec{Image: testImage}, nil, sbConfig)
require.NoError(t, err)
defer func() {
assert.NoError(t, imageService.RemoveImage(&runtime.ImageSpec{Image: img}))
}()
sbConfig := PodSandboxConfig("sandbox", "sandbox-unknown-state")
t.Log("Should not be able to create sandbox without runc")
tmpRuncPath := Randomize(runcPath)
require.NoError(t, os.Rename(runcPath, tmpRuncPath))