Move test-only volume files to test-only volume package

This commit is contained in:
Tim St. Clair
2016-02-29 13:31:42 -08:00
parent 83d74dd952
commit 246b389275
27 changed files with 114 additions and 85 deletions

View File

@@ -28,13 +28,14 @@ import (
"k8s.io/kubernetes/pkg/util/mount"
utiltesting "k8s.io/kubernetes/pkg/util/testing"
"k8s.io/kubernetes/pkg/volume"
volumetest "k8s.io/kubernetes/pkg/volume/testing"
"k8s.io/kubernetes/pkg/volume/util"
)
// Construct an instance of a plugin, by name.
func makePluginUnderTest(t *testing.T, plugName, basePath string) volume.VolumePlugin {
plugMgr := volume.VolumePluginMgr{}
plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost(basePath, nil, nil))
plugMgr.InitPlugins(ProbeVolumePlugins(), volumetest.NewFakeVolumeHost(basePath, nil, nil))
plug, err := plugMgr.FindPluginByName(plugName)
if err != nil {
@@ -300,7 +301,7 @@ func TestMetrics(t *testing.T) {
// Need to create the subdirectory
os.MkdirAll(builder.GetPath(), 0755)
expectedEmptyDirUsage, err := volume.FindEmptyDirectoryUsageOnTmpfs()
expectedEmptyDirUsage, err := volumetest.FindEmptyDirectoryUsageOnTmpfs()
if err != nil {
t.Errorf("Unexpected error finding expected empty directory usage on tmpfs: %v", err)
}