From 315266b25e01967e1956f252386d633ba39677c2 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 8 Feb 2019 20:47:08 +0100 Subject: [PATCH] e2e: refine snapshot test This addresses the two remaining change requests from https://github.com/kubernetes/kubernetes/pull/69036: - replace "csi-hostpath-v0" name check with capability check (cleaner that way) - add feature tag to "should create snapshot with defaults" because that is an alpha feature Signed-off-by: Patrick Ohly --- test/e2e/storage/testsuites/snapshottable.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/e2e/storage/testsuites/snapshottable.go b/test/e2e/storage/testsuites/snapshottable.go index cd3c73a50b8..a6969cb888d 100644 --- a/test/e2e/storage/testsuites/snapshottable.go +++ b/test/e2e/storage/testsuites/snapshottable.go @@ -80,6 +80,10 @@ func (s *snapshottableTestSuite) getTestSuiteInfo() TestSuiteInfo { } func (s *snapshottableTestSuite) skipUnsupportedTest(pattern testpatterns.TestPattern, driver TestDriver) { + dInfo := driver.GetDriverInfo() + if !dInfo.Capabilities[CapDataSource] { + framework.Skipf("Driver %q does not support snapshots - skipping", dInfo.Name) + } } func createSnapshottableTestInput(driver TestDriver, pattern testpatterns.TestPattern) (snapshottableTestResource, snapshottableTestInput) { @@ -187,10 +191,7 @@ type snapshottableTestInput struct { } func testSnapshot(input *snapshottableTestInput) { - It("should create snapshot with defaults", func() { - if input.dInfo.Name == "csi-hostpath-v0" { - framework.Skipf("skip test when using driver csi-hostpath-v0 - skipping") - } + It("should create snapshot with defaults [Feature:VolumeSnapshotDataSource]", func() { TestCreateSnapshot(input.testCase, input.cs, input.dc, input.pvc, input.sc, input.vsc) }) }