Add dashboard command integration test

pull/776/head
Jimmi Dyson 2016-10-29 09:30:20 +01:00
parent a8a22c0212
commit b64ad5c457
No known key found for this signature in database
GPG Key ID: 978CD4AF4C1E87F5
1 changed files with 18 additions and 0 deletions

View File

@ -20,6 +20,8 @@ package integration
import (
"fmt"
"net"
"net/url"
"strings"
"testing"
"time"
@ -102,4 +104,20 @@ func TestDashboard(t *testing.T) {
if err := commonutil.RetryAfter(10, checkDashboard, 5*time.Second); err != nil {
t.Fatalf("Dashboard is unhealthy: %s", err)
}
dashboardURL := minikubeRunner.RunCommand("dashboard --url", true)
u, err := url.Parse(strings.TrimSpace(dashboardURL))
if err != nil {
t.Fatalf("failed to parse dashboard URL %s: %v", dashboardURL, err)
}
if u.Scheme != "http" {
t.Fatalf("wrong scheme in dashboard URL, expected http, actual %s", u.Scheme)
}
_, port, err := net.SplitHostPort(u.Host)
if err != nil {
t.Fatalf("failed to split dashboard host %s: %v", u.Host, err)
}
if port != "30000" {
t.Fatalf("Dashboard is exposed on wrong port, expected 30000, actual %s", port)
}
}