Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test driver's unique name consistent #70769

Merged
merged 1 commit into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/storage/csi_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ var _ = utils.SIGDescribe("CSI Volumes", func() {
test := t
It(test.name, func() {
if test.driverExists {
csiDriver := createCSIDriver(csics, "csi-hostpath-"+f.UniqueName, test.driverAttachable)
csiDriver := createCSIDriver(csics, drivers.GetUniqueDriverName(driver), test.driverAttachable)
if csiDriver != nil {
defer csics.CsiV1alpha1().CSIDrivers().Delete(csiDriver.Name, nil)
}
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/storage/drivers/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,8 @@ func getStorageClass(
VolumeBindingMode: bindingMode,
}
}

// GetUniqueDriverName returns unique driver name that can be used parallelly in tests
func GetUniqueDriverName(driver TestDriver) string {
return fmt.Sprintf("%s-%s", driver.GetDriverInfo().Name, driver.GetDriverInfo().Framework.UniqueName)
}
8 changes: 4 additions & 4 deletions test/e2e/storage/drivers/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (h *hostpathCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern
}

func (h *hostpathCSIDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1.StorageClass {
provisioner := h.driverInfo.Name + h.driverInfo.Framework.UniqueName
provisioner := GetUniqueDriverName(h)
parameters := map[string]string{}
ns := h.driverInfo.Framework.Namespace.Name
suffix := fmt.Sprintf("%s-sc", provisioner)
Expand All @@ -105,7 +105,7 @@ func (h *hostpathCSIDriver) CreateDriver() {
// settings are ignored for this test. We could patch the image definitions.
o := utils.PatchCSIOptions{
OldDriverName: h.driverInfo.Name,
NewDriverName: h.driverInfo.Name + h.driverInfo.Framework.UniqueName,
NewDriverName: GetUniqueDriverName(h),
DriverContainerName: "hostpath",
ProvisionerContainerName: "csi-provisioner",
NodeName: h.driverInfo.Config.ServerNodeName,
Expand Down Expand Up @@ -199,8 +199,8 @@ func (g *gcePDCSIDriver) CreateDriver() {
//
// These are the options which would have to be used:
// o := utils.PatchCSIOptions{
// OldDriverName: "com.google.csi.gcepd",
// NewDriverName: "com.google.csi.gcepd-" + g.f.UniqueName,
// OldDriverName: g.driverInfo.Name,
// NewDriverName: GetUniqueDriverName(g),
// DriverContainerName: "gce-driver",
// ProvisionerContainerName: "csi-external-provisioner",
// }
Expand Down