add a clean code for TestCanSupport

update other location

forgot two files need to be updated
This commit is contained in:
guangxuli
2016-10-08 16:58:56 +08:00
parent 88c11d4b79
commit 2c9e84f50f
3 changed files with 16 additions and 10 deletions

View File

@@ -43,7 +43,8 @@ func newTestHost(t *testing.T) (string, volume.VolumeHost) {
func TestCanSupport(t *testing.T) {
plugMgr := volume.VolumePluginMgr{}
_, host := newTestHost(t)
tempDir, host := newTestHost(t)
defer os.RemoveAll(tempDir)
plugMgr.InitPlugins(ProbeVolumePlugins(), host)
plug, err := plugMgr.FindPluginByName("kubernetes.io/git-repo")
@@ -221,6 +222,7 @@ func doTestPlugin(scenario struct {
plugMgr := volume.VolumePluginMgr{}
rootDir, host := newTestHost(t)
defer os.RemoveAll(rootDir)
plugMgr.InitPlugins(ProbeVolumePlugins(), host)
plug, err := plugMgr.FindPluginByName("kubernetes.io/git-repo")