提交 a533b565 编写于 作者: H Himanshu Pandey

Fixed the test case

上级 a4018bfa
...@@ -78,9 +78,12 @@ func TestStartStop(t *testing.T) { ...@@ -78,9 +78,12 @@ func TestStartStop(t *testing.T) {
} }
// check for the current-context before and after the stop // check for the current-context before and after the stop
kubeRunner := util.NewKubeCtlRunner() kubectlRunner := util.NewKubectlRunner(t)
currentContext := kubeRunner.RunCommand("config", "current-context") currentContext, err := kubectlRunner.RunCommand([]string{"config", "current-context"})
if currentContext != "minikube" { if err != nil {
t.Fatalf("Failed to fetch current-context")
}
if string(currentContext) != "minikube" {
t.Fatalf("current-context not set to minikube") t.Fatalf("current-context not set to minikube")
} }
...@@ -89,8 +92,11 @@ func TestStartStop(t *testing.T) { ...@@ -89,8 +92,11 @@ func TestStartStop(t *testing.T) {
return r.CheckStatusNoFail(state.Stopped.String()) return r.CheckStatusNoFail(state.Stopped.String())
} }
currentContext := kubeRunner.RunCommand("config", "current-context") currentContext, err = kubectlRunner.RunCommand([]string{"config", "current-context"})
if currentContext != "" { if err != nil {
t.Fatalf("Failed to fetch current-context")
}
if string(currentContext) != "" {
t.Fatalf("Failed to unset the current-context") t.Fatalf("Failed to unset the current-context")
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册