Merge pull request #8359 from kiashok/argsEscapedTestFix

Fix argsEscaped tests
This commit is contained in:
Kazuyoshi Kato 2023-04-14 13:08:51 -07:00 committed by GitHub
commit ffc70c45c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -54,7 +54,7 @@ func initImages(imageListFile string) {
ResourceConsumer: "registry.k8s.io/e2e-test-images/resource-consumer:1.10", ResourceConsumer: "registry.k8s.io/e2e-test-images/resource-consumer:1.10",
VolumeCopyUp: "ghcr.io/containerd/volume-copy-up:2.1", VolumeCopyUp: "ghcr.io/containerd/volume-copy-up:2.1",
VolumeOwnership: "ghcr.io/containerd/volume-ownership:2.1", VolumeOwnership: "ghcr.io/containerd/volume-ownership:2.1",
ArgsEscaped: "cplatpublic.azurecr.io/args-escaped-test-image-ns:latest", ArgsEscaped: "cplatpublic.azurecr.io/args-escaped-test-image-ns:1.0",
} }
if imageListFile != "" { if imageListFile != "" {

View File

@ -3,4 +3,4 @@ busybox = "docker.io/library/busybox:latest"
pause = "registry.k8s.io/pause:3.7" pause = "registry.k8s.io/pause:3.7"
VolumeCopyUp = "ghcr.io/containerd/volume-copy-up:2.1" VolumeCopyUp = "ghcr.io/containerd/volume-copy-up:2.1"
VolumeOwnership = "ghcr.io/containerd/volume-ownership:2.1" VolumeOwnership = "ghcr.io/containerd/volume-ownership:2.1"
ArgsEscaped = "cplatpublic.azurecr.io/args-escaped-test-image-ns:latest" ArgsEscaped = "cplatpublic.azurecr.io/args-escaped-test-image-ns:1.0"

View File

@ -127,12 +127,14 @@ func runHostProcess(t *testing.T, expectErr bool, image string, action hpcAction
action(t, cn, containerConfig) action(t, cn, containerConfig)
} }
func startAndTestContainer(t *testing.T, sb string, sbConfig *runtime.PodSandboxConfig, cnConfig *runtime.ContainerConfig) { func runAndRemoveContainer(t *testing.T, sb string, sbConfig *runtime.PodSandboxConfig, cnConfig *runtime.ContainerConfig) {
t.Log("Create the container") t.Log("Create the container")
cn, err := runtimeService.CreateContainer(sb, cnConfig, sbConfig) cn, err := runtimeService.CreateContainer(sb, cnConfig, sbConfig)
require.NoError(t, err) require.NoError(t, err)
t.Log("Start the container") t.Log("Start the container")
require.NoError(t, runtimeService.StartContainer(cn)) require.NoError(t, runtimeService.StartContainer(cn))
// Wait few seconds for the container to be completely initialized
time.Sleep(5 * time.Second)
t.Log("Stop the container") t.Log("Stop the container")
require.NoError(t, runtimeService.StopContainer(cn, 0)) require.NoError(t, runtimeService.StopContainer(cn, 0))
@ -185,6 +187,6 @@ func TestArgsEscapedImagesOnWindows(t *testing.T) {
localSystemUsername, localSystemUsername,
) )
startAndTestContainer(t, sb, sbConfig, cnConfigWithCtrCmd) runAndRemoveContainer(t, sb, sbConfig, cnConfigWithCtrCmd)
startAndTestContainer(t, sb, sbConfig, cnConfigNoCtrCmd) runAndRemoveContainer(t, sb, sbConfig, cnConfigNoCtrCmd)
} }