Skip to content

Commit

Permalink
update Pod RestartPolicy OnFailure e2e test case
Browse files Browse the repository at this point in the history
  • Loading branch information
songjiaxun committed Feb 17, 2024
1 parent b8c4e21 commit 57dc6c7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/e2e/testsuites/auto_termination.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,14 @@ func (t *gcsFuseCSIAutoTerminationTestSuite) DefineTests(driver storageframework
tPod := specs.NewTestPod(f.ClientSet, f.Namespace)
tPod.SetRestartPolicy(v1.RestartPolicyOnFailure)
tPod.SetupVolume(l.volumeResource, "test-gcsfuse-volume", mountPath, false)
tPod.SetCommand(fmt.Sprintf("echo 'hello world' > %v/data && grep 'hello world' %v/data", mountPath, mountPath))
cmd := []string{
"sleep 10;",
fmt.Sprintf("if [ -f %v/testfile ]; then echo 'Completed Successfully!'; exit 0; fi;", mountPath),
fmt.Sprintf("touch %v/testfile;", mountPath),
"echo 'Job Failed!';",
"exit 1;",
}
tPod.SetCommand(strings.Join(cmd, " "))

ginkgo.By("Deploying the pod")
tPod.Create(ctx)
Expand Down

0 comments on commit 57dc6c7

Please sign in to comment.