Unverified Commit 1847c071 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #74445 from msau42/fix-localssd-e2e

Fix localssd test panic
parents 1d2d2d0a 6266c479
...@@ -45,7 +45,7 @@ import ( ...@@ -45,7 +45,7 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
rbacv1beta1 "k8s.io/api/rbac/v1beta1" rbacv1beta1 "k8s.io/api/rbac/v1beta1"
storagev1 "k8s.io/api/storage/v1" storagev1 "k8s.io/api/storage/v1"
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
...@@ -1651,6 +1651,17 @@ func (l *localDriver) GetDriverInfo() *testsuites.DriverInfo { ...@@ -1651,6 +1651,17 @@ func (l *localDriver) GetDriverInfo() *testsuites.DriverInfo {
} }
func (l *localDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) { func (l *localDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
}
func (l *localDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConfig, func()) {
// choose a randome node to test against
nodes := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
l.node = &nodes.Items[rand.Intn(len(nodes.Items))]
l.hostExec = utils.NewHostExec(f)
l.ltrMgr = utils.NewLocalResourceManager("local-driver", l.hostExec, "/tmp")
// This can't be done in SkipUnsupportedTest because the test framework is not initialized yet
if l.volumeType == utils.LocalVolumeGCELocalSSD { if l.volumeType == utils.LocalVolumeGCELocalSSD {
ssdInterface := "scsi" ssdInterface := "scsi"
filesystemType := "fs" filesystemType := "fs"
...@@ -1663,15 +1674,6 @@ func (l *localDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) { ...@@ -1663,15 +1674,6 @@ func (l *localDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
framework.Skipf("Requires at least 1 %s %s localSSD ", ssdInterface, filesystemType) framework.Skipf("Requires at least 1 %s %s localSSD ", ssdInterface, filesystemType)
} }
} }
}
func (l *localDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConfig, func()) {
// choose a randome node to test against
nodes := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
l.node = &nodes.Items[rand.Intn(len(nodes.Items))]
l.hostExec = utils.NewHostExec(f)
l.ltrMgr = utils.NewLocalResourceManager("local-driver", l.hostExec, "/tmp")
return &testsuites.PerTestConfig{ return &testsuites.PerTestConfig{
Driver: l, Driver: l,
......
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