diff --git a/integration/addition_gids_test.go b/integration/addition_gids_test.go index d608a74b3..f1433f1cd 100644 --- a/integration/addition_gids_test.go +++ b/integration/addition_gids_test.go @@ -36,7 +36,7 @@ func TestAdditionalGids(t *testing.T) { t.Log("Create a sandbox with log directory") sbConfig := PodSandboxConfig("sandbox", "additional-gids", WithPodLogDirectory(testPodLogDir)) - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/container_log_test.go b/integration/container_log_test.go index 561e2a883..4f62298aa 100644 --- a/integration/container_log_test.go +++ b/integration/container_log_test.go @@ -39,7 +39,7 @@ func TestLongContainerLog(t *testing.T) { sbConfig := PodSandboxConfig("sandbox", "long-container-log", WithPodLogDirectory(testPodLogDir), ) - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/container_stats_test.go b/integration/container_stats_test.go index 0780ffe3b..9db49dea9 100644 --- a/integration/container_stats_test.go +++ b/integration/container_stats_test.go @@ -31,7 +31,7 @@ import ( func TestContainerStats(t *testing.T) { t.Logf("Create a pod config and run sandbox container") sbConfig := PodSandboxConfig("sandbox1", "stats") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) @@ -76,7 +76,7 @@ func TestContainerStats(t *testing.T) { func TestContainerListStats(t *testing.T) { t.Logf("Create a pod config and run sandbox container") sbConfig := PodSandboxConfig("running-pod", "statsls") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) @@ -131,7 +131,7 @@ func TestContainerListStats(t *testing.T) { func TestContainerListStatsWithIdFilter(t *testing.T) { t.Logf("Create a pod config and run sandbox container") sbConfig := PodSandboxConfig("running-pod", "statsls") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) @@ -191,7 +191,7 @@ func TestContainerListStatsWithIdFilter(t *testing.T) { func TestContainerListStatsWithSandboxIdFilter(t *testing.T) { t.Logf("Create a pod config and run sandbox container") sbConfig := PodSandboxConfig("running-pod", "statsls") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) @@ -247,7 +247,7 @@ func TestContainerListStatsWithSandboxIdFilter(t *testing.T) { func TestContainerListStatsWithIdSandboxIdFilter(t *testing.T) { t.Logf("Create a pod config and run sandbox container") sbConfig := PodSandboxConfig("running-pod", "statsls") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/container_update_resources_test.go b/integration/container_update_resources_test.go index 36e6b7374..b7e8589e3 100644 --- a/integration/container_update_resources_test.go +++ b/integration/container_update_resources_test.go @@ -39,7 +39,7 @@ func checkMemoryLimit(t *testing.T, spec *runtimespec.Spec, memLimit int64) { func TestUpdateContainerResources(t *testing.T) { t.Log("Create a sandbox") sbConfig := PodSandboxConfig("sandbox", "update-container-resources") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/containerd_image_test.go b/integration/containerd_image_test.go index 291d52a4d..7356094fe 100644 --- a/integration/containerd_image_test.go +++ b/integration/containerd_image_test.go @@ -121,7 +121,7 @@ func TestContainerdImage(t *testing.T) { t.Logf("should be able to start container with the image") sbConfig := PodSandboxConfig("sandbox", "containerd-image") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/duplicate_name_test.go b/integration/duplicate_name_test.go index 53f195011..857591f4a 100644 --- a/integration/duplicate_name_test.go +++ b/integration/duplicate_name_test.go @@ -26,7 +26,7 @@ import ( func TestDuplicateName(t *testing.T) { t.Logf("Create a sandbox") sbConfig := PodSandboxConfig("sandbox", "duplicate-name") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) @@ -34,7 +34,7 @@ func TestDuplicateName(t *testing.T) { }() t.Logf("Create the sandbox again should fail") - _, err = runtimeService.RunPodSandbox(sbConfig) + _, err = runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.Error(t, err) t.Logf("Create a container") diff --git a/integration/image_load_test.go b/integration/image_load_test.go index 32b53e5af..c5772ce28 100644 --- a/integration/image_load_test.go +++ b/integration/image_load_test.go @@ -70,7 +70,7 @@ func TestImageLoad(t *testing.T) { t.Logf("create a container with the loaded image") sbConfig := PodSandboxConfig("sandbox", Randomize("image-load")) - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/imagefs_info_test.go b/integration/imagefs_info_test.go index 3e82e5ed2..7f5b5c533 100644 --- a/integration/imagefs_info_test.go +++ b/integration/imagefs_info_test.go @@ -37,7 +37,7 @@ func TestImageFSInfo(t *testing.T) { }() t.Logf("Create a sandbox to make sure there is an active snapshot") config := PodSandboxConfig("running-pod", "imagefs") - sb, err := runtimeService.RunPodSandbox(config) + sb, err := runtimeService.RunPodSandbox(config, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/pod_hostname_env_test.go b/integration/pod_hostname_env_test.go index 191943ecd..0757ba25b 100644 --- a/integration/pod_hostname_env_test.go +++ b/integration/pod_hostname_env_test.go @@ -63,7 +63,7 @@ func TestPodHostnameEnv(t *testing.T) { opts := append(test.opts, WithPodLogDirectory(testPodLogDir)) t.Log("Create a sandbox with hostname") sbConfig := PodSandboxConfig("sandbox", "hostname-env", opts...) - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) diff --git a/integration/restart_test.go b/integration/restart_test.go index e1c3bc1ad..2c9f149ca 100644 --- a/integration/restart_test.go +++ b/integration/restart_test.go @@ -91,7 +91,7 @@ func TestContainerdRestart(t *testing.T) { for i := range sandboxes { s := &sandboxes[i] sbCfg := PodSandboxConfig(s.name, sandboxNS) - sid, err := runtimeService.RunPodSandbox(sbCfg) + sid, err := runtimeService.RunPodSandbox(sbCfg, *runtimeHandler) require.NoError(t, err) defer func() { // Make sure the sandbox is cleaned up in any case. diff --git a/integration/sandbox_clean_remove_test.go b/integration/sandbox_clean_remove_test.go index b8fb69fd6..395987a0e 100644 --- a/integration/sandbox_clean_remove_test.go +++ b/integration/sandbox_clean_remove_test.go @@ -31,7 +31,7 @@ func TestSandboxCleanRemove(t *testing.T) { ctx := context.Background() t.Logf("Create a sandbox") sbConfig := PodSandboxConfig("sandbox", "clean-remove") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { // Make sure the sandbox is cleaned up in any case. diff --git a/integration/test_utils.go b/integration/test_utils.go index cece345df..8a802cdf7 100644 --- a/integration/test_utils.go +++ b/integration/test_utils.go @@ -58,6 +58,7 @@ var ( var criEndpoint = flag.String("cri-endpoint", "unix:///run/containerd/containerd.sock", "The endpoint of cri plugin.") var criRoot = flag.String("cri-root", "/var/lib/containerd/io.containerd.grpc.v1.cri", "The root directory of cri plugin.") +var runtimeHandler = flag.String("runtime-handler", "", "The runtime handler to use in the test.") func init() { flag.Parse() diff --git a/integration/truncindex_test.go b/integration/truncindex_test.go index 8c9c1bd9a..54f87be00 100644 --- a/integration/truncindex_test.go +++ b/integration/truncindex_test.go @@ -55,7 +55,7 @@ func TestTruncIndex(t *testing.T) { t.Logf("Create a sandbox") sbConfig := PodSandboxConfig("sandbox", "truncindex") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) sbTruncIndex := genTruncIndex(sb) var hasStoppedSandbox bool diff --git a/integration/volume_copy_up_test.go b/integration/volume_copy_up_test.go index 1fa4cbea5..e1e02630e 100644 --- a/integration/volume_copy_up_test.go +++ b/integration/volume_copy_up_test.go @@ -35,7 +35,7 @@ func TestVolumeCopyUp(t *testing.T) { t.Logf("Create a sandbox") sbConfig := PodSandboxConfig("sandbox", "volume-copy-up") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb)) @@ -97,7 +97,7 @@ func TestVolumeOwnership(t *testing.T) { t.Logf("Create a sandbox") sbConfig := PodSandboxConfig("sandbox", "volume-ownership") - sb, err := runtimeService.RunPodSandbox(sbConfig) + sb, err := runtimeService.RunPodSandbox(sbConfig, *runtimeHandler) require.NoError(t, err) defer func() { assert.NoError(t, runtimeService.StopPodSandbox(sb))