Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
430abfbd
Commit
430abfbd
authored
Dec 08, 2016
by
NickrenREN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cinder attacher GetDeviceMountPath
add function to test GetDeviceMountPath func return value
parent
9484212b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
attacher_test.go
pkg/volume/cinder/attacher_test.go
+21
-0
No files found.
pkg/volume/cinder/attacher_test.go
View file @
430abfbd
...
...
@@ -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
type
testcase
struct
{
name
string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment