From a68e0848dc6927316e3e14a95031958d1ec35b94 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Tue, 29 Sep 2015 10:53:54 +0200 Subject: [PATCH] Factor out providers which support SSH in e2e tests --- test/e2e/core.go | 2 +- test/e2e/service.go | 2 +- test/e2e/ssh.go | 2 +- test/e2e/util.go | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/e2e/core.go b/test/e2e/core.go index 2d1c42b754e..19f4c857386 100644 --- a/test/e2e/core.go +++ b/test/e2e/core.go @@ -38,7 +38,7 @@ func CoreDump(dir string) { provider := testContext.Provider // requires ssh - if !providerIs("gce", "gke") { + if !providerIs(providersWithSSH...) { fmt.Printf("Skipping SSH core dump, which is not implemented for %s", provider) return } diff --git a/test/e2e/service.go b/test/e2e/service.go index e6ae07a0fd2..e8d4fbcd6ae 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -238,7 +238,7 @@ var _ = Describe("Services", func() { It("should be able to up and down services", func() { // this test uses NodeSSHHosts that does not work if a Node only reports LegacyHostIP - SkipUnlessProviderIs("gce", "gke", "aws") + SkipUnlessProviderIs(providersWithSSH...) ns := namespaces[0] numPods, servicePort := 3, 80 diff --git a/test/e2e/ssh.go b/test/e2e/ssh.go index a78101c6156..2efdf36af18 100644 --- a/test/e2e/ssh.go +++ b/test/e2e/ssh.go @@ -35,7 +35,7 @@ var _ = Describe("SSH", func() { Expect(err).NotTo(HaveOccurred()) // When adding more providers here, also implement their functionality in util.go's getSigner(...). - SkipUnlessProviderIs("gce", "gke") + SkipUnlessProviderIs(providersWithSSH...) }) It("should SSH to all nodes and run commands", func() { diff --git a/test/e2e/util.go b/test/e2e/util.go index 92f89b4ef74..b1b9a8f0187 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -241,6 +241,9 @@ func providerIs(providers ...string) bool { return false } +// providersWithSSH are those providers where each node is accessible with SSH +var providersWithSSH = []string{"gce", "gke", "aws"} + type podCondition func(pod *api.Pod) (bool, error) // podReady returns whether pod has a condition of Ready with a status of true.