Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change file path for restart tests to avoid permission issue #1389

Merged
merged 1 commit into from
May 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions test/cri-containerd/containerdrestart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func Test_Container_CRI_Restart(t *testing.T) {
// test preserving state after restarting pod
func Test_Container_CRI_Restart_State(t *testing.T) {
testFile := "t.txt"
wcowTestFile := `C:\Users\ContainerUser\t.txt`

client := newTestRuntimeClient(t)
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -253,8 +254,8 @@ func Test_Container_CRI_Restart_State(t *testing.T) {
Runtime: wcowHypervisorRuntimeHandler,
Image: imageWindowsNanoserver,
Command: []string{"cmd", "/c", "ping -t 127.0.0.1"},
SetStateCommand: []string{"cmd", "/c", "echo - >> " + testFile},
GetStateCommand: []string{"cmd", "/c", "type", testFile},
SetStateCommand: []string{"cmd", "/c", "echo - >> " + wcowTestFile},
GetStateCommand: []string{"cmd", "/c", "type", wcowTestFile},
ExpectedResult: "- \r\n",
},
{
Expand All @@ -263,8 +264,8 @@ func Test_Container_CRI_Restart_State(t *testing.T) {
Runtime: wcowHypervisorRuntimeHandler,
Image: imageWindowsNanoserver,
Command: []string{"cmd", "/c", "ping -t 127.0.0.1"},
SetStateCommand: []string{"cmd", "/c", "echo - >> " + testFile},
GetStateCommand: []string{"cmd", "/c", "type", testFile},
SetStateCommand: []string{"cmd", "/c", "echo - >> " + wcowTestFile},
GetStateCommand: []string{"cmd", "/c", "type", wcowTestFile},
ExpectedResult: "- \r\n",
},
}
Expand Down Expand Up @@ -320,6 +321,7 @@ func Test_Container_CRI_Restart_State(t *testing.T) {
if req.ExitCode != 0 {
t.Fatalf("exec %v failed with exit code %d: %s", startExecRequest.Cmd, req.ExitCode, string(req.Stderr))
}
t.Logf("exec: %s", tt.SetStateCommand)

// check the write worked
startExecRequest = &runtime.ExecSyncRequest{
Expand Down