skip tests that uses default storage class when there is no default storage class installed

This commit is contained in:
Léiyì Zhang 2021-11-17 19:14:16 +00:00
parent 1367cca8fd
commit 496ccc06ad
3 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,7 @@ var _ = utils.SIGDescribe("GenericPersistentVolume[Disruptive]", func() {
pv *v1.PersistentVolume pv *v1.PersistentVolume
) )
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
e2epv.SkipIfNoDefaultStorageClass(c)
framework.Logf("Initializing pod and pvcs for test") framework.Logf("Initializing pod and pvcs for test")
clientPod, pvc, pv = createPodPVCFromSC(f, c, ns) clientPod, pvc, pv = createPodPVCFromSC(f, c, ns)
}) })

View File

@ -65,6 +65,7 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() {
// and the underlying storage driver and therefore don't pass // and the underlying storage driver and therefore don't pass
// with other kinds of clusters and drivers. // with other kinds of clusters and drivers.
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws") e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws")
e2epv.SkipIfNoDefaultStorageClass(c)
defaultScName, err = e2epv.GetDefaultStorageClassName(c) defaultScName, err = e2epv.GetDefaultStorageClassName(c)
framework.ExpectNoError(err) framework.ExpectNoError(err)

View File

@ -669,6 +669,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
// Modifying the default storage class can be disruptive to other tests that depend on it // Modifying the default storage class can be disruptive to other tests that depend on it
ginkgo.It("should be disabled by removing the default annotation [Serial] [Disruptive]", func() { ginkgo.It("should be disabled by removing the default annotation [Serial] [Disruptive]", func() {
e2eskipper.SkipUnlessProviderIs("openstack", "gce", "aws", "gke", "vsphere", "azure") e2eskipper.SkipUnlessProviderIs("openstack", "gce", "aws", "gke", "vsphere", "azure")
e2epv.SkipIfNoDefaultStorageClass(c)
scName, scErr := e2epv.GetDefaultStorageClassName(c) scName, scErr := e2epv.GetDefaultStorageClassName(c)
framework.ExpectNoError(scErr) framework.ExpectNoError(scErr)