mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 23:57:49 +00:00
Merge pull request #38374 from NickrenREN/cinder-getDeviceMountPath-test
Automatic merge from submit-queue cinder attacher GetDeviceMountPath
This commit is contained in:
commit
abe2b3ce1c
@ -57,6 +57,27 @@ func TestGetDeviceName_PersistentVolume(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetDeviceMountPath(t *testing.T) {
|
||||||
|
name := "cinder-volume-id"
|
||||||
|
spec := createVolSpec(name, false)
|
||||||
|
rootDir := "/var/lib/kubelet/"
|
||||||
|
host := volumetest.NewFakeVolumeHost(rootDir, nil, nil)
|
||||||
|
|
||||||
|
attacher := &cinderDiskAttacher{
|
||||||
|
host: host,
|
||||||
|
}
|
||||||
|
|
||||||
|
//test the path
|
||||||
|
path, err := attacher.GetDeviceMountPath(spec)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Get device mount path error")
|
||||||
|
}
|
||||||
|
expectedPath := rootDir + "plugins/kubernetes.io/cinder/mounts/" + name
|
||||||
|
if path != expectedPath {
|
||||||
|
t.Errorf("Device mount path error: expected %s, got %s ", expectedPath, path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// One testcase for TestAttachDetach table test below
|
// One testcase for TestAttachDetach table test below
|
||||||
type testcase struct {
|
type testcase struct {
|
||||||
name string
|
name string
|
||||||
|
Loading…
Reference in New Issue
Block a user