From 8690724443a93bc45856602819bee92e23892e23 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Thu, 18 Jun 2015 10:27:08 -0700 Subject: [PATCH] Update the addons test so it doesn't try to create clients on providers that aren't gce. --- test/e2e/addon_update.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/e2e/addon_update.go b/test/e2e/addon_update.go index 1ddca8fa9cf..c17d8a91c5e 100644 --- a/test/e2e/addon_update.go +++ b/test/e2e/addon_update.go @@ -196,6 +196,11 @@ var _ = Describe("Addon update", func() { var namespace *api.Namespace BeforeEach(func() { + // This test requires SSH, so the provider check should be identical to + // those tests. + if !providerIs("gce") { + return + } var err error c, err = loadClient() Expect(err).NotTo(HaveOccurred()) @@ -211,6 +216,11 @@ var _ = Describe("Addon update", func() { }) AfterEach(func() { + // This test requires SSH, so the provider check should be identical to + // those tests. + if !providerIs("gce") { + return + } if sshClient != nil { // restart addon_update with the default options sshExec(sshClient, "sudo /etc/init.d/kube-addons restart") @@ -226,10 +236,6 @@ var _ = Describe("Addon update", func() { // WARNING: the test is not parallel-friendly! It("should propagate add-on file changes", func() { - //these tests are long, so I squeezed several cases in one scenario - Expect(sshClient).NotTo(BeNil()) - dir = namespace.Name // we use it only to give a unique string for each test execution - // This test requires SSH, so the provider check should be identical to // those tests. if !providerIs("gce") { @@ -237,6 +243,10 @@ var _ = Describe("Addon update", func() { return } + //these tests are long, so I squeezed several cases in one scenario + Expect(sshClient).NotTo(BeNil()) + dir = namespace.Name // we use it only to give a unique string for each test execution + temporaryRemotePathPrefix := "addon-test-dir" temporaryRemotePath := temporaryRemotePathPrefix + "/" + dir // in home directory on kubernetes-master defer sshExec(sshClient, fmt.Sprintf("rm -rf %s", temporaryRemotePathPrefix)) // ignore the result in cleanup