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
64955959
Commit
64955959
authored
Nov 15, 2016
by
Jing Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable NFSv4 and GlusterFS tests on cluster e2e tests
Enable NFSv4 and GlusterFS tests on cluster e2e tests for GCI images only.
parent
28d273c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
volumes.go
test/e2e/common/volumes.go
+24
-16
No files found.
test/e2e/common/volumes.go
View file @
64955959
...
@@ -353,7 +353,7 @@ var _ = framework.KubeDescribe("GCP Volumes", func() {
...
@@ -353,7 +353,7 @@ var _ = framework.KubeDescribe("GCP Volumes", func() {
var
namespace
*
api
.
Namespace
var
namespace
*
api
.
Namespace
BeforeEach
(
func
()
{
BeforeEach
(
func
()
{
if
!
isTestEnabled
()
{
if
!
isTestEnabled
(
f
.
ClientSet
)
{
framework
.
Skipf
(
"NFS tests are not supported for this distro"
)
framework
.
Skipf
(
"NFS tests are not supported for this distro"
)
}
}
namespace
=
f
.
Namespace
namespace
=
f
.
Namespace
...
@@ -468,24 +468,32 @@ var _ = framework.KubeDescribe("GCP Volumes", func() {
...
@@ -468,24 +468,32 @@ var _ = framework.KubeDescribe("GCP Volumes", func() {
})
})
})
})
func
isTestEnabled
()
bool
{
func
isTestEnabled
(
c
clientset
.
Interface
)
bool
{
// TODO(timstclair): Pass this through the image setup rather than hardcoding.
// Enable the test If the node image is GCI. (this check only works for node e2e test)
if
strings
.
Contains
(
framework
.
TestContext
.
NodeName
,
"-gci-dev-"
)
{
nodeName
:=
framework
.
TestContext
.
NodeName
gciVersionRe
:=
regexp
.
MustCompile
(
"-gci-dev-([0-9]+)-"
)
if
nodeName
!=
""
{
matches
:=
gciVersionRe
.
FindStringSubmatch
(
framework
.
TestContext
.
NodeName
)
if
strings
.
Contains
(
nodeName
,
"-gci-dev-"
)
{
if
len
(
matches
)
==
2
{
gciVersionRe
:=
regexp
.
MustCompile
(
"-gci-dev-([0-9]+)-"
)
version
,
err
:=
strconv
.
Atoi
(
matches
[
1
])
matches
:=
gciVersionRe
.
FindStringSubmatch
(
framework
.
TestContext
.
NodeName
)
if
err
!=
nil
{
if
len
(
matches
)
==
2
{
glog
.
Errorf
(
"Error parsing GCI version from NodeName %q: %v"
,
framework
.
TestContext
.
NodeName
,
err
)
version
,
err
:=
strconv
.
Atoi
(
matches
[
1
])
return
false
if
err
!=
nil
{
glog
.
Errorf
(
"Error parsing GCI version from NodeName %q: %v"
,
nodeName
,
err
)
return
false
}
return
version
>=
54
}
}
return
version
>=
54
}
}
return
false
return
false
}
}
// Disable tests for containvm
if
strings
.
Contains
(
framework
.
TestContext
.
NodeName
,
"-containervm-"
)
{
// For cluster e2e test, because nodeName is empty, retrieve the node objects from api server
//return true
// and check their images. Only run NFSv4 and GlusterFS if nodes are using GCI image for now.
nodes
:=
framework
.
GetReadySchedulableNodesOrDie
(
c
)
for
_
,
node
:=
range
nodes
.
Items
{
if
!
strings
.
Contains
(
node
.
Status
.
NodeInfo
.
OSImage
,
"Google Container-VM"
)
{
return
false
}
}
}
return
fals
e
return
tru
e
}
}
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