From 21c41e79e51e9af3f7b7063a2317a1afd02c531b Mon Sep 17 00:00:00 2001 From: Zhecheng Li Date: Wed, 8 Jun 2022 18:17:22 +0800 Subject: [PATCH] Skip tests if SSH not working Functions involves TestVolumeUnmountsFromDeletedPodWithForceOption need to check if SSH works. Signed-off-by: Zhecheng Li --- test/e2e/storage/generic_persistent_volume-disruptive.go | 2 ++ test/e2e/storage/nfs_persistent_volume-disruptive.go | 1 + test/e2e/storage/testsuites/disruptive.go | 1 + test/e2e/storage/testsuites/subpath.go | 2 ++ 4 files changed, 6 insertions(+) diff --git a/test/e2e/storage/generic_persistent_volume-disruptive.go b/test/e2e/storage/generic_persistent_volume-disruptive.go index 7de7bb4c845..79ca3109825 100644 --- a/test/e2e/storage/generic_persistent_volume-disruptive.go +++ b/test/e2e/storage/generic_persistent_volume-disruptive.go @@ -62,6 +62,7 @@ var _ = utils.SIGDescribe("GenericPersistentVolume[Disruptive]", func() { runTest: utils.TestVolumeUnmountsFromForceDeletedPod, }, } + ginkgo.Context("When kubelet restarts", func() { // Test table housing the ginkgo.It() title string and test spec. runTest is type testBody, defined at // the start of this file. To add tests, define a function mirroring the testBody signature and assign @@ -79,6 +80,7 @@ var _ = utils.SIGDescribe("GenericPersistentVolume[Disruptive]", func() { for _, test := range disruptiveTestTable { func(t disruptiveTest) { ginkgo.It(t.testItStmt, func(ctx context.Context) { + e2eskipper.SkipUnlessSSHKeyPresent() ginkgo.By("Executing Spec") t.runTest(c, f, clientPod, e2epod.VolumeMountPath1) }) diff --git a/test/e2e/storage/nfs_persistent_volume-disruptive.go b/test/e2e/storage/nfs_persistent_volume-disruptive.go index 7cf657030cd..db30c61f3f5 100644 --- a/test/e2e/storage/nfs_persistent_volume-disruptive.go +++ b/test/e2e/storage/nfs_persistent_volume-disruptive.go @@ -271,6 +271,7 @@ var _ = utils.SIGDescribe("NFSPersistentVolumes[Disruptive][Flaky]", func() { for _, test := range disruptiveTestTable { func(t disruptiveTest) { ginkgo.It(t.testItStmt, func(ctx context.Context) { + e2eskipper.SkipUnlessSSHKeyPresent() ginkgo.By("Executing Spec") t.runTest(c, f, clientPod, e2epod.VolumeMountPath1) }) diff --git a/test/e2e/storage/testsuites/disruptive.go b/test/e2e/storage/testsuites/disruptive.go index 02731bc69a3..fc6d024b794 100644 --- a/test/e2e/storage/testsuites/disruptive.go +++ b/test/e2e/storage/testsuites/disruptive.go @@ -71,6 +71,7 @@ func (s *disruptiveTestSuite) SkipUnsupportedTests(driver storageframework.TestD if pattern.VolMode == v1.PersistentVolumeBlock && !driver.GetDriverInfo().Capabilities[storageframework.CapBlock] { e2eskipper.Skipf("Driver %s doesn't support %v -- skipping", driver.GetDriverInfo().Name, pattern.VolMode) } + e2eskipper.SkipUnlessSSHKeyPresent() } func (s *disruptiveTestSuite) DefineTests(driver storageframework.TestDriver, pattern storageframework.TestPattern) { diff --git a/test/e2e/storage/testsuites/subpath.go b/test/e2e/storage/testsuites/subpath.go index 9cb4255b344..4decdaf77c4 100644 --- a/test/e2e/storage/testsuites/subpath.go +++ b/test/e2e/storage/testsuites/subpath.go @@ -339,6 +339,7 @@ func (s *subPathTestSuite) DefineTests(driver storageframework.TestDriver, patte }) ginkgo.It("should unmount if pod is gracefully deleted while kubelet is down [Disruptive][Slow][LinuxOnly]", func(ctx context.Context) { + e2eskipper.SkipUnlessSSHKeyPresent() init() defer cleanup() @@ -351,6 +352,7 @@ func (s *subPathTestSuite) DefineTests(driver storageframework.TestDriver, patte }) ginkgo.It("should unmount if pod is force deleted while kubelet is down [Disruptive][Slow][LinuxOnly]", func(ctx context.Context) { + e2eskipper.SkipUnlessSSHKeyPresent() init() defer cleanup()