MCPcopy
hub / github.com/containerd/containerd / runHostProcess

Function runHostProcess

integration/windows_hostprocess_test.go:101–128  ·  view source on GitHub ↗
(t *testing.T, expectErr bool, image string, action hpcAction, opts ...ContainerOpts)

Source from the content-addressed store, hash-verified

99}
100
101func runHostProcess(t *testing.T, expectErr bool, image string, action hpcAction, opts ...ContainerOpts) {
102 t.Logf("Create a pod config and run sandbox container")
103 sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox1", "hostprocess", WithWindowsHostProcessPod)
104
105 t.Logf("Create a container config and run container in a pod")
106 containerConfig := ContainerConfig(
107 "container1",
108 image,
109 opts...,
110 )
111 cn, err := runtimeService.CreateContainer(sb, containerConfig, sbConfig)
112 require.NoError(t, err)
113 defer func() {
114 assert.NoError(t, runtimeService.RemoveContainer(cn))
115 }()
116 _, err = t, runtimeService.StartContainer(cn)
117 if err != nil {
118 if !expectErr {
119 t.Fatalf("Unexpected error while starting Container: %v", err)
120 }
121 return
122 }
123 defer func() {
124 assert.NoError(t, runtimeService.StopContainer(cn, 10))
125 }()
126
127 action(t, cn, containerConfig)
128}
129
130func runExecAndRemoveContainer(t *testing.T, sb string, sbConfig *runtime.PodSandboxConfig, cnConfig *runtime.ContainerConfig) {
131 t.Log("Create the container")

Callers 1

TestWindowsHostProcessFunction · 0.85

Calls 6

ContainerConfigFunction · 0.85
CreateContainerMethod · 0.65
RemoveContainerMethod · 0.65
StartContainerMethod · 0.65
StopContainerMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…