From a533b5653f00b4bae8745ac9f2a1a6daea6806fe Mon Sep 17 00:00:00 2001 From: Himanshu Pandey Date: Thu, 2 May 2019 09:47:08 -0700 Subject: [PATCH] Fixed the test case --- test/integration/start_stop_delete_test.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 2f6ad27d1..42aae34c4 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -78,9 +78,12 @@ func TestStartStop(t *testing.T) { } // check for the current-context before and after the stop - kubeRunner := util.NewKubeCtlRunner() - currentContext := kubeRunner.RunCommand("config", "current-context") - if currentContext != "minikube" { + kubectlRunner := util.NewKubectlRunner(t) + currentContext, err := kubectlRunner.RunCommand([]string{"config", "current-context"}) + if err != nil { + t.Fatalf("Failed to fetch current-context") + } + if string(currentContext) != "minikube" { t.Fatalf("current-context not set to minikube") } @@ -89,8 +92,11 @@ func TestStartStop(t *testing.T) { return r.CheckStatusNoFail(state.Stopped.String()) } - currentContext := kubeRunner.RunCommand("config", "current-context") - if currentContext != "" { + currentContext, err = kubectlRunner.RunCommand([]string{"config", "current-context"}) + if err != nil { + t.Fatalf("Failed to fetch current-context") + } + if string(currentContext) != "" { t.Fatalf("Failed to unset the current-context") } -- GitLab