Skip to content

Commit 3739099

Browse files
committed
utils.go: Changed bashExec to shExec, bash not guaranteed.
1 parent 2fac3f2 commit 3739099

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/e2e/storage/utils/utils.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,44 +64,44 @@ const (
6464
)
6565

6666
// PodExec runs f.ExecCommandInContainerWithFullOutput to execute a shell cmd in target pod
67-
func PodExec(f *framework.Framework, pod *v1.Pod, bashExec string) (string, error) {
68-
stdout, _, err := f.ExecCommandInContainerWithFullOutput(pod.Name, pod.Spec.Containers[0].Name, "/bin/sh", "-c", bashExec)
67+
func PodExec(f *framework.Framework, pod *v1.Pod, shExec string) (string, error) {
68+
stdout, _, err := f.ExecCommandInContainerWithFullOutput(pod.Name, pod.Spec.Containers[0].Name, "/bin/sh", "-c", shExec)
6969
return stdout, err
7070
}
7171

72-
// VerifyExecInPodSucceed verifies bash cmd in target pod succeed
73-
func VerifyExecInPodSucceed(f *framework.Framework, pod *v1.Pod, bashExec string) {
74-
_, err := PodExec(f, pod, bashExec)
72+
// VerifyExecInPodSucceed verifies shell cmd in target pod succeed
73+
func VerifyExecInPodSucceed(f *framework.Framework, pod *v1.Pod, shExec string) {
74+
_, err := PodExec(f, pod, shExec)
7575
if err != nil {
7676
if err, ok := err.(uexec.CodeExitError); ok {
7777
exitCode := err.ExitStatus()
7878
framework.ExpectNoError(err,
7979
"%q should succeed, but failed with exit code %d and error message %q",
80-
bashExec, exitCode, err)
80+
shExec, exitCode, err)
8181
} else {
8282
framework.ExpectNoError(err,
8383
"%q should succeed, but failed with error message %q",
84-
bashExec, err)
84+
shExec, err)
8585
}
8686
}
8787
}
8888

89-
// VerifyExecInPodFail verifies bash cmd in target pod fail with certain exit code
90-
func VerifyExecInPodFail(f *framework.Framework, pod *v1.Pod, bashExec string, exitCode int) {
91-
_, err := PodExec(f, pod, bashExec)
89+
// VerifyExecInPodFail verifies shell cmd in target pod fail with certain exit code
90+
func VerifyExecInPodFail(f *framework.Framework, pod *v1.Pod, shExec string, exitCode int) {
91+
_, err := PodExec(f, pod, shExec)
9292
if err != nil {
9393
if err, ok := err.(clientexec.ExitError); ok {
9494
actualExitCode := err.ExitStatus()
9595
framework.ExpectEqual(actualExitCode, exitCode,
9696
"%q should fail with exit code %d, but failed with exit code %d and error message %q",
97-
bashExec, exitCode, actualExitCode, err)
97+
shExec, exitCode, actualExitCode, err)
9898
} else {
9999
framework.ExpectNoError(err,
100100
"%q should fail with exit code %d, but failed with error message %q",
101-
bashExec, exitCode, err)
101+
shExec, exitCode, err)
102102
}
103103
}
104-
framework.ExpectError(err, "%q should fail with exit code %d, but exit without error", bashExec, exitCode)
104+
framework.ExpectError(err, "%q should fail with exit code %d, but exit without error", shExec, exitCode)
105105
}
106106

107107
func isSudoPresent(nodeIP string, provider string) bool {

0 commit comments

Comments
 (0)