@@ -64,44 +64,44 @@ const (
64
64
)
65
65
66
66
// 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 )
69
69
return stdout , err
70
70
}
71
71
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 )
75
75
if err != nil {
76
76
if err , ok := err .(uexec.CodeExitError ); ok {
77
77
exitCode := err .ExitStatus ()
78
78
framework .ExpectNoError (err ,
79
79
"%q should succeed, but failed with exit code %d and error message %q" ,
80
- bashExec , exitCode , err )
80
+ shExec , exitCode , err )
81
81
} else {
82
82
framework .ExpectNoError (err ,
83
83
"%q should succeed, but failed with error message %q" ,
84
- bashExec , err )
84
+ shExec , err )
85
85
}
86
86
}
87
87
}
88
88
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 )
92
92
if err != nil {
93
93
if err , ok := err .(clientexec.ExitError ); ok {
94
94
actualExitCode := err .ExitStatus ()
95
95
framework .ExpectEqual (actualExitCode , exitCode ,
96
96
"%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 )
98
98
} else {
99
99
framework .ExpectNoError (err ,
100
100
"%q should fail with exit code %d, but failed with error message %q" ,
101
- bashExec , exitCode , err )
101
+ shExec , exitCode , err )
102
102
}
103
103
}
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 )
105
105
}
106
106
107
107
func isSudoPresent (nodeIP string , provider string ) bool {
0 commit comments