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
bbe42664
Commit
bbe42664
authored
Oct 09, 2015
by
Robert Bailey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15158 from mesosphere/jdef-fix-flocker-unittest
MESOS: flocker unit test should clean up after itself
parents
3bbfe48e
a7c06e57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
plugin_test.go
pkg/volume/flocker/plugin_test.go
+14
-7
No files found.
pkg/volume/flocker/plugin_test.go
View file @
bbe42664
...
...
@@ -17,6 +17,8 @@ limitations under the License.
package
flocker
import
(
"io/ioutil"
"os"
"testing"
flockerClient
"github.com/ClusterHQ/flocker-go"
...
...
@@ -28,15 +30,17 @@ import (
const
pluginName
=
"kubernetes.io/flocker"
func
newInitializedVolumePlugMgr
(
)
volume
.
VolumePluginMgr
{
func
newInitializedVolumePlugMgr
(
t
*
testing
.
T
)
(
volume
.
VolumePluginMgr
,
string
)
{
plugMgr
:=
volume
.
VolumePluginMgr
{}
plugMgr
.
InitPlugins
(
ProbeVolumePlugins
(),
volume
.
NewFakeVolumeHost
(
"/foo/bar"
,
nil
,
nil
))
return
plugMgr
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"flocker"
)
assert
.
NoError
(
t
,
err
)
plugMgr
.
InitPlugins
(
ProbeVolumePlugins
(),
volume
.
NewFakeVolumeHost
(
dir
,
nil
,
nil
))
return
plugMgr
,
dir
}
func
TestGetByName
(
t
*
testing
.
T
)
{
assert
:=
assert
.
New
(
t
)
plugMgr
:=
newInitializedVolumePlugMgr
(
)
plugMgr
,
_
:=
newInitializedVolumePlugMgr
(
t
)
plug
,
err
:=
plugMgr
.
FindPluginByName
(
pluginName
)
assert
.
NotNil
(
plug
,
"Can't find the plugin by name"
)
...
...
@@ -45,7 +49,7 @@ func TestGetByName(t *testing.T) {
func
TestCanSupport
(
t
*
testing
.
T
)
{
assert
:=
assert
.
New
(
t
)
plugMgr
:=
newInitializedVolumePlugMgr
(
)
plugMgr
,
_
:=
newInitializedVolumePlugMgr
(
t
)
plug
,
err
:=
plugMgr
.
FindPluginByName
(
pluginName
)
assert
.
NoError
(
err
)
...
...
@@ -113,7 +117,7 @@ func TestGetFlockerVolumeSource(t *testing.T) {
func
TestNewBuilder
(
t
*
testing
.
T
)
{
assert
:=
assert
.
New
(
t
)
plugMgr
:=
newInitializedVolumePlugMgr
(
)
plugMgr
,
_
:=
newInitializedVolumePlugMgr
(
t
)
plug
,
err
:=
plugMgr
.
FindPluginByName
(
pluginName
)
assert
.
NoError
(
err
)
...
...
@@ -196,7 +200,10 @@ func TestSetUpAtInternal(t *testing.T) {
assert
:=
assert
.
New
(
t
)
plugMgr
:=
newInitializedVolumePlugMgr
()
plugMgr
,
rootDir
:=
newInitializedVolumePlugMgr
(
t
)
if
rootDir
!=
""
{
defer
os
.
RemoveAll
(
rootDir
)
}
plug
,
err
:=
plugMgr
.
FindPluginByName
(
flockerPluginName
)
assert
.
NoError
(
err
)
...
...
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