Add integration test
to make sure apiserver is up and running and that the pod can be accessed via kubectl.pull/5757/head
parent
993967bcc7
commit
c3dd5bc0c6
|
@ -60,6 +60,7 @@ func TestFunctional(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{"StartWithProxy", validateStartWithProxy}, // Set everything else up for success
|
{"StartWithProxy", validateStartWithProxy}, // Set everything else up for success
|
||||||
{"KubeContext", validateKubeContext}, // Racy: must come immediately after "minikube start"
|
{"KubeContext", validateKubeContext}, // Racy: must come immediately after "minikube start"
|
||||||
|
{"KubeContext", validateKubectlGetPods}, // Make sure apiserver is up
|
||||||
{"CacheCmd", validateCacheCmd}, // Caches images needed for subsequent tests because of proxy
|
{"CacheCmd", validateCacheCmd}, // Caches images needed for subsequent tests because of proxy
|
||||||
}
|
}
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
|
@ -142,6 +143,17 @@ func validateKubeContext(ctx context.Context, t *testing.T, profile string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// validateKubectlGetPods asserts that `kubectl get pod -A` returns non-zero content
|
||||||
|
func validateKubectlGetPods(ctx context.Context, t *testing.T, profile string) {
|
||||||
|
rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "get", "pod", "-A"))
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("%s failed: %v", rr.Args, err)
|
||||||
|
}
|
||||||
|
if !strings.Contains(rr.Stdout.String(), "kube-apiserver-minikube") {
|
||||||
|
t.Errorf("kube-apiserver-minikube is not up in running, got: %s\n", rr.Stdout.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// validateAddonManager asserts that the kube-addon-manager pod is deployed properly
|
// validateAddonManager asserts that the kube-addon-manager pod is deployed properly
|
||||||
func validateAddonManager(ctx context.Context, t *testing.T, profile string) {
|
func validateAddonManager(ctx context.Context, t *testing.T, profile string) {
|
||||||
// If --wait=false, this may take a couple of minutes
|
// If --wait=false, this may take a couple of minutes
|
||||||
|
|
Loading…
Reference in New Issue