diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 2b8c4a52752..bb66594b4ad 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -315,6 +315,12 @@ func SkipIfProviderIs(unsupportedProviders ...string) { } } +func SkipUnlessSSHKeyPresent() { + if _, err := GetSigner(TestContext.Provider); err != nil { + Skipf("No SSH Key for provider %s: '%v'", TestContext.Provider, err) + } +} + func SkipUnlessProviderIs(supportedProviders ...string) { if !ProviderIs(supportedProviders...) { Skipf("Only supported for providers %v (not %s)", supportedProviders, TestContext.Provider) diff --git a/test/e2e/service.go b/test/e2e/service.go index 7e4300d618b..a68305d2690 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -279,6 +279,9 @@ var _ = framework.KubeDescribe("Services", func() { // TODO: use the ServiceTestJig here // this test uses framework.NodeSSHHosts that does not work if a Node only reports LegacyHostIP framework.SkipUnlessProviderIs(framework.ProvidersWithSSH...) + // this test does not work if the Node does not support SSH Key + framework.SkipUnlessSSHKeyPresent() + ns := f.Namespace.Name numPods, servicePort := 3, 80 diff --git a/test/e2e/ssh.go b/test/e2e/ssh.go index 802eed5c296..12750a63506 100644 --- a/test/e2e/ssh.go +++ b/test/e2e/ssh.go @@ -34,6 +34,10 @@ var _ = framework.KubeDescribe("SSH", func() { BeforeEach(func() { // When adding more providers here, also implement their functionality in util.go's framework.GetSigner(...). framework.SkipUnlessProviderIs(framework.ProvidersWithSSH...) + + // This test SSH's into the node for which it needs the $HOME/.ssh/id_rsa key to be present. So + // we should skip if the environment does not have the key (not all CI systems support this use case) + framework.SkipUnlessSSHKeyPresent() }) It("should SSH to all nodes and run commands", func() {