MCPcopy Index your code
hub / github.com/containerd/containerd / TestRuntimeHandler

Function TestRuntimeHandler

integration/runtime_handler_test.go:28–46  ·  view source on GitHub ↗

TODO(chrisfegly): add/update test(s) to allow testing of multiple runtimes at the same time

(t *testing.T)

Source from the content-addressed store, hash-verified

26
27// TODO(chrisfegly): add/update test(s) to allow testing of multiple runtimes at the same time
28func TestRuntimeHandler(t *testing.T) {
29 t.Logf("Create a sandbox")
30 if *runtimeHandler == "" {
31 t.Logf("The --runtime-handler flag value is empty which results internally to setting the default runtime")
32 } else {
33 t.Logf("The --runtime-handler flag value is %s", *runtimeHandler)
34 }
35 sb, _ := PodSandboxConfigWithCleanup(t, "sandbox", "test-runtime-handler")
36
37 t.Logf("Verify runtimeService.PodSandboxStatus() returns previously set runtimeHandler")
38 sbStatus, err := runtimeService.PodSandboxStatus(sb)
39 require.NoError(t, err)
40 assert.Equal(t, *runtimeHandler, sbStatus.RuntimeHandler)
41
42 t.Logf("Verify runtimeService.ListPodSandbox() returns previously set runtimeHandler")
43 sandboxes, err := runtimeService.ListPodSandbox(&runtime.PodSandboxFilter{})
44 require.NoError(t, err)
45 assert.Equal(t, *runtimeHandler, sandboxes[0].RuntimeHandler)
46}

Callers

nothing calls this directly

Calls 3

PodSandboxStatusMethod · 0.45
ListPodSandboxMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…