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
abe2b3ce
Commit
abe2b3ce
authored
Dec 20, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Dec 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38374 from NickrenREN/cinder-getDeviceMountPath-test
Automatic merge from submit-queue cinder attacher GetDeviceMountPath
parents
e150a6e3
430abfbd
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 @
abe2b3ce
...
@@ -57,6 +57,27 @@ func TestGetDeviceName_PersistentVolume(t *testing.T) {
...
@@ -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
...
...
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