...
1
16
17 package flexvolume
18
19 import (
20 "testing"
21
22 "k8s.io/kubernetes/test/utils/harness"
23 )
24
25 func TestDetach(tt *testing.T) {
26 t := harness.For(tt)
27 defer t.Close()
28
29 plugin, _ := testPlugin(t)
30 plugin.runner = fakeRunner(
31 assertDriverCall(t, notSupportedOutput(), detachCmd,
32 "sdx", "localhost"),
33 )
34
35 d, _ := plugin.NewDetacher()
36 d.Detach("sdx", "localhost")
37 }
38
39 func TestUnmountDevice(tt *testing.T) {
40 t := harness.For(tt)
41 defer t.Close()
42
43 plugin, rootDir := testPlugin(t)
44 plugin.runner = fakeRunner(
45 assertDriverCall(t, notSupportedOutput(), unmountDeviceCmd,
46 rootDir+"/mount-dir"),
47 )
48
49 d, _ := plugin.NewDetacher()
50 d.UnmountDevice(rootDir + "/mount-dir")
51 }
52
View as plain text