diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index b0053972d1..bb4efa3701 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -70,11 +70,12 @@ func TestFunctional(t *testing.T) { name string validator validateFunc }{ - {"CopySyncFile", setupFileSync}, // Set file for the file sync test case - {"StartWithProxy", validateStartWithProxy}, // Set everything else up for success - {"KubeContext", validateKubeContext}, // Racy: must come immediately after "minikube start" - {"KubectlGetPods", validateKubectlGetPods}, // Make sure apiserver is up - {"CacheCmd", validateCacheCmd}, // Caches images needed for subsequent tests because of proxy + {"CopySyncFile", setupFileSync}, // Set file for the file sync test case + {"StartWithProxy", validateStartWithProxy}, // Set everything else up for success + {"KubeContext", validateKubeContext}, // Racy: must come immediately after "minikube start" + {"KubectlGetPods", validateKubectlGetPods}, // Make sure apiserver is up + {"CacheCmd", validateCacheCmd}, // Caches images needed for subsequent tests because of proxy + {"MinikubeKubectlCmd", validateMinikubeKubectl}, // Make sure `minikube kubectl` works } for _, tc := range tests { tc := tc @@ -206,6 +207,15 @@ func validateKubectlGetPods(ctx context.Context, t *testing.T, profile string) { } } +// validateMinikubeKubectl validates that the `minikube kubectl` command returns content +func validateMinikubeKubectl(ctx context.Context, t *testing.T, profile string) { + kubectlArgs := []string{"kubectl", "--", "get", "pods"} + rr, err := Run(t, exec.CommandContext(ctx, Target(), kubectlArgs...)) + if err != nil { + t.Fatalf("%s failed: %v", rr.Args, err) + } +} + // validateComponentHealth asserts that all Kubernetes components are healthy func validateComponentHealth(ctx context.Context, t *testing.T, profile string) { rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "get", "cs", "-o=json"))