Unverified Commit 7dbe426b authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #74320 from gnufied/cleanup-csi-test-dups

Add e2e for CSI volume limit
parents 5d0e293b 2516cbd4
......@@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"csi_mock_volume.go",
"csi_volumes.go",
"detach_mounted.go",
"empty_dir_wrapper.go",
......
......@@ -38,6 +38,7 @@ package drivers
import (
"fmt"
"math/rand"
"strconv"
. "github.com/onsi/ginkgo"
storagev1 "k8s.io/api/storage/v1"
......@@ -171,13 +172,14 @@ type mockCSIDriver struct {
manifests []string
podInfoVersion *string
attachable bool
attachLimit int
}
var _ testsuites.TestDriver = &mockCSIDriver{}
var _ testsuites.DynamicPVTestDriver = &mockCSIDriver{}
// InitMockCSIDriver returns a mockCSIDriver that implements TestDriver interface
func InitMockCSIDriver(registerDriver, driverAttachable bool, podInfoVersion *string) testsuites.TestDriver {
func InitMockCSIDriver(registerDriver, driverAttachable bool, podInfoVersion *string, attachLimit int) testsuites.TestDriver {
driverManifests := []string{
"test/e2e/testing-manifests/storage-csi/cluster-driver-registrar/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/driver-registrar/rbac.yaml",
......@@ -213,6 +215,7 @@ func InitMockCSIDriver(registerDriver, driverAttachable bool, podInfoVersion *st
manifests: driverManifests,
podInfoVersion: podInfoVersion,
attachable: driverAttachable,
attachLimit: attachLimit,
}
}
......@@ -256,6 +259,10 @@ func (m *mockCSIDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTest
containerArgs = append(containerArgs, "--disable-attach")
}
if m.attachLimit > 0 {
containerArgs = append(containerArgs, "--attach-limit", strconv.Itoa(m.attachLimit))
}
// TODO (?): the storage.csi.image.version and storage.csi.image.registry
// settings are ignored for this test. We could patch the image definitions.
o := utils.PatchCSIOptions{
......
......@@ -47,7 +47,6 @@ var _ = utils.SIGDescribe("Volume limits", func() {
framework.Failf("Expected volume limits to be set")
}
}
})
})
......
......@@ -44,6 +44,8 @@ spec:
apiVersion: v1
fieldPath: spec.nodeName
imagePullPolicy: Always
securityContext:
privileged: true
volumeMounts:
- mountPath: /csi
name: socket-dir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment