Skip to content

Commit

Permalink
test/e2e: Enable Volumes testsuite
Browse files Browse the repository at this point in the history
Volumes testsuite ensures that various volume sources are working.

Added "xfs" to TestDriver.SupportedFsType, so that now tests are covered xfs
volumes. This discovered the issue intel#429 whitch could be fixed by increasing volume
sizes to 16Mi as per
mkfs.xfs(http://man7.org/linux/man-pages/man8/mkfs.xfs.8.html) documentation.

NOTE: Volumes testsuite is using host kubectl binary while running the tests. So
might not work in CI, unless it installs kubectl binary.

Fixes: intel#429
  • Loading branch information
avalluri committed Oct 14, 2019
1 parent 37760ff commit bd357fb
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions test/e2e/storage/csi_volumes.go
Expand Up @@ -24,7 +24,7 @@ import (
"sync"
"sync/atomic"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -64,22 +64,22 @@ var _ = Describe("PMEM Volumes", func() {
Name: "pmem-csi",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedFsType: sets.NewString(
"", // Default fsType
"ext4", "xfs",
),
Capabilities: map[testsuites.Capability]bool{
testsuites.CapPersistence: true,
testsuites.CapFsGroup: true,
testsuites.CapExec: true,
},
},
scManifest: "deploy/kubernetes-1.13/pmem-storageclass-ext4.yaml",
// Renaming of the driver *not* enabled. It doesn't support
// that because there is only one instance of the registry
// and on each node the driver assumes that it has exclusive
// control of the PMEM. As a result, tests have to be run
// sequentially becaust each test creates and removes
// the driver deployment.
claimSize: "1Mi",
scManifest: map[string]string{
"ext4": "deploy/kubernetes-1.13/pmem-storageclass-ext4.yaml",
"xfs": "deploy/kubernetes-1.13/pmem-storageclass-xfs.yaml",
},
// We use 16Mi size volumes because this is the minimum size supported
// by xfs filesystem's allocation group
// Ref: http://man7.org/linux/man-pages/man8/mkfs.xfs.8.html
claimSize: "16Mi",
}
},
}
Expand All @@ -93,7 +93,7 @@ var _ = Describe("PMEM Volumes", func() {
// testsuites.InitSubPathTestSuite,
// testsuites.InitVolumeIOTestSuite,
// testsuites.InitVolumeModeTestSuite,
// testsuites.InitVolumesTestSuite,
testsuites.InitVolumesTestSuite,
}

for _, initDriver := range csiTestDrivers {
Expand Down Expand Up @@ -199,7 +199,7 @@ type manifestDriver struct {
driverInfo testsuites.DriverInfo
patchOptions utils.PatchCSIOptions
manifests []string
scManifest string
scManifest map[string]string
claimSize string
cleanup func()
}
Expand All @@ -217,16 +217,19 @@ func (m *manifestDriver) SkipUnsupportedTest(testpatterns.TestPattern) {
func (m *manifestDriver) GetDynamicProvisionStorageClass(config *testsuites.PerTestConfig, fsType string) *storagev1.StorageClass {
f := config.Framework

items, err := f.LoadFromManifests(m.scManifest)
scManifest, ok := m.scManifest[fsType]
Expect(ok).To(BeTrue(), "Unsupported filesystem type %s", fsType)

items, err := f.LoadFromManifests(scManifest)
Expect(err).NotTo(HaveOccurred())
Expect(len(items)).To(Equal(1), "exactly one item from %s", m.scManifest)
Expect(len(items)).To(Equal(1), "exactly one item from %s", scManifest)

err = f.PatchItems(items...)
Expect(err).NotTo(HaveOccurred())
err = utils.PatchCSIDeployment(f, m.finalPatchOptions(f), items[0])

sc, ok := items[0].(*storagev1.StorageClass)
Expect(ok).To(BeTrue(), "storage class from %s", m.scManifest)
Expect(ok).To(BeTrue(), "storage class from %s", scManifest)
return sc
}

Expand Down

0 comments on commit bd357fb

Please sign in to comment.