From 203e76020e75cfa07c052554d8b6b9e1799ae94b Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 25 Nov 2014 11:30:15 -0800 Subject: [PATCH 1/2] Add a test for important URLs. --- cmd/e2e/e2e.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cmd/e2e/e2e.go b/cmd/e2e/e2e.go index 396fd4f2983..969643b8774 100644 --- a/cmd/e2e/e2e.go +++ b/cmd/e2e/e2e.go @@ -169,6 +169,28 @@ func TestPodUpdate(c *client.Client) bool { return true } +// TestImportantURLs validates that URLs that people depend on haven't moved. +// ***IMPORTANT*** Do *not* fix this test just by changing the path. If you moved a URL +// you can break upstream dependencies. +func TestImportantURLs(c *client.Client) bool { + tests := []struct { + path string + }{} + ok := true + for _, test := range tests { + glog.Infof("testing: %s", test.path) + data, err := c.RESTClient.Get(). + AbsPath(test.path). + Do(). + Raw() + } + if err != nil { + glog.Errorf("Failed: %v\nBody: %s", err, string(data)) + ok := false + } + return ok +} + // TestKubeletSendsEvent checks that kubelets and scheduler send events about pods scheduling and running. func TestKubeletSendsEvent(c *client.Client) bool { provider := os.Getenv("KUBERNETES_PROVIDER") From d43343db5e27364e10bb45f49a0e4577938fb1cf Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 25 Nov 2014 15:41:52 -0800 Subject: [PATCH 2/2] Add a test for important URLs on the apiserver. --- cmd/e2e/e2e.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/e2e/e2e.go b/cmd/e2e/e2e.go index 969643b8774..f131a03605a 100644 --- a/cmd/e2e/e2e.go +++ b/cmd/e2e/e2e.go @@ -175,7 +175,11 @@ func TestPodUpdate(c *client.Client) bool { func TestImportantURLs(c *client.Client) bool { tests := []struct { path string - }{} + }{ + {path: "/validate"}, + {path: "/healthz"}, + // TODO: test proxy links here + } ok := true for _, test := range tests { glog.Infof("testing: %s", test.path) @@ -183,10 +187,10 @@ func TestImportantURLs(c *client.Client) bool { AbsPath(test.path). Do(). Raw() - } - if err != nil { - glog.Errorf("Failed: %v\nBody: %s", err, string(data)) - ok := false + if err != nil { + glog.Errorf("Failed: %v\nBody: %s", err, string(data)) + ok = false + } } return ok } @@ -288,6 +292,7 @@ func main() { tests := []func(c *client.Client) bool{ TestKubernetesROService, TestKubeletSendsEvent, + TestImportantURLs, // TODO(brendandburns): fix this test and re-add it: TestPodUpdate, }