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
feb7abca
Commit
feb7abca
authored
Apr 18, 2015
by
Robert Bailey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that e2e tests run on gce|gke and are appropriately
skipped for other cloud providers.
parent
b37328a5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
22 deletions
+31
-22
certs.go
test/e2e/certs.go
+1
-1
es_cluster_logging.go
test/e2e/es_cluster_logging.go
+1
-2
kubectl.go
test/e2e/kubectl.go
+5
-4
monitoring.go
test/e2e/monitoring.go
+1
-1
pd.go
test/e2e/pd.go
+1
-1
rc.go
test/e2e/rc.go
+3
-4
service.go
test/e2e/service.go
+1
-1
shell.go
test/e2e/shell.go
+6
-8
util.go
test/e2e/util.go
+12
-0
No files found.
test/e2e/certs.go
View file @
feb7abca
...
...
@@ -32,7 +32,7 @@ var _ = Describe("MasterCerts", func() {
})
It
(
"should have all expected certs on the master"
,
func
()
{
if
testContext
.
Provider
!=
"gce"
&&
testContext
.
Provider
!=
"gke"
{
if
!
providerIs
(
"gce"
,
"gke"
)
{
By
(
fmt
.
Sprintf
(
"Skipping MasterCerts test for cloud provider %s (only supported for gce and gke)"
,
testContext
.
Provider
))
return
}
...
...
test/e2e/es_cluster_logging.go
View file @
feb7abca
...
...
@@ -57,11 +57,10 @@ func bodyToJSON(body []byte) (map[string]interface{}, error) {
// ClusterLevelLoggingWithElasticsearch is an end to end test for cluster level logging.
func
ClusterLevelLoggingWithElasticsearch
(
c
*
client
.
Client
)
{
// TODO: For now assume we are only testing cluster logging with Elasticsearch
// on GCE. Once we are sure that Elasticsearch cluster level logging
// works for other providers we should widen this scope of this test.
if
testContext
.
Provider
!=
"gce"
{
if
!
providerIs
(
"gce"
)
{
Logf
(
"Skipping cluster level logging test for provider %s"
,
testContext
.
Provider
)
return
}
...
...
test/e2e/kubectl.go
View file @
feb7abca
...
...
@@ -97,11 +97,12 @@ var _ = Describe("kubectl", func() {
Describe
(
"guestbook"
,
func
()
{
var
guestbookPath
=
filepath
.
Join
(
testContext
.
RepoRoot
,
"examples/guestbook"
)
if
testContext
.
Provider
!=
"gce"
&&
testContext
.
Provider
!=
"gke"
{
By
(
fmt
.
Sprintf
(
"Skipping guestbook, uses createExternalLoadBalancer, a (gce|gke) feature"
))
}
It
(
"should create and stop a working application"
,
func
()
{
if
!
providerIs
(
"gce"
,
"gke"
)
{
By
(
fmt
.
Sprintf
(
"Skipping guestbook, uses createExternalLoadBalancer, a (gce|gke) feature"
))
return
}
defer
cleanup
(
guestbookPath
,
frontendSelector
,
redisMasterSelector
,
redisSlaveSelector
)
By
(
"creating all guestbook components"
)
...
...
test/e2e/monitoring.go
View file @
feb7abca
...
...
@@ -42,7 +42,7 @@ var _ = Describe("Monitoring", func() {
})
It
(
"verify monitoring pods and all cluster nodes are available on influxdb using heapster."
,
func
()
{
if
testContext
.
Provider
!=
"gce"
{
if
!
providerIs
(
"gce"
)
{
By
(
fmt
.
Sprintf
(
"Skipping Monitoring test, which is only supported for provider gce (not %s)"
,
testContext
.
Provider
))
return
...
...
test/e2e/pd.go
View file @
feb7abca
...
...
@@ -57,7 +57,7 @@ var _ = Describe("PD", func() {
})
It
(
"should schedule a pod w/ a RW PD, remove it, then schedule it on another host"
,
func
()
{
if
testContext
.
Provider
!=
"gce"
&&
testContext
.
Provider
!=
"aws"
{
if
!
providerIs
(
"gce"
,
"aws"
)
{
By
(
fmt
.
Sprintf
(
"Skipping PD test, which is only supported for providers gce & aws (not %s)"
,
testContext
.
Provider
))
return
...
...
test/e2e/rc.go
View file @
feb7abca
...
...
@@ -46,13 +46,12 @@ var _ = Describe("ReplicationController", func() {
})
It
(
"should serve a basic image on each replica with a private image"
,
func
()
{
switch
testContext
.
Provider
{
case
"gce"
,
"gke"
:
ServeImageOrFail
(
c
,
"private"
,
"gcr.io/_b_k8s_authenticated_test/serve_hostname:1.1"
)
default
:
if
!
providerIs
(
"gce"
,
"gke"
)
{
By
(
fmt
.
Sprintf
(
"Skipping private variant, which is only supported for providers gce and gke (not %s)"
,
testContext
.
Provider
))
return
}
ServeImageOrFail
(
c
,
"private"
,
"gcr.io/_b_k8s_authenticated_test/serve_hostname:1.1"
)
})
})
...
...
test/e2e/service.go
View file @
feb7abca
...
...
@@ -47,7 +47,7 @@ var _ = Describe("Services", func() {
})
It
(
"should provide DNS for the cluster"
,
func
()
{
if
testContext
.
Provider
==
"vagrant"
{
if
providerIs
(
"vagrant"
)
{
By
(
"Skipping test which is broken for vagrant (See https://github.com/GoogleCloudPlatform/kubernetes/issues/3580)"
)
return
}
...
...
test/e2e/shell.go
View file @
feb7abca
...
...
@@ -35,14 +35,6 @@ var (
var
_
=
Describe
(
"Shell"
,
func
()
{
defer
GinkgoRecover
()
// A number of scripts only work on gce
if
testContext
.
Provider
!=
"gce"
&&
testContext
.
Provider
!=
"gke"
{
By
(
fmt
.
Sprintf
(
"Skipping Shell test, which is only supported for provider gce and gke (not %s)"
,
testContext
.
Provider
))
return
}
// Slurp up all the tests in hack/e2e-suite
bashE2ERoot
:=
filepath
.
Join
(
root
,
"hack/e2e-suite"
)
files
,
err
:=
ioutil
.
ReadDir
(
bashE2ERoot
)
...
...
@@ -53,6 +45,12 @@ var _ = Describe("Shell", func() {
for
_
,
file
:=
range
files
{
fileName
:=
file
.
Name
()
// Make a copy
It
(
fmt
.
Sprintf
(
"tests that %v passes"
,
fileName
),
func
()
{
// A number of scripts only work on gce
if
!
providerIs
(
"gce"
,
"gke"
)
{
By
(
fmt
.
Sprintf
(
"Skipping Shell test %s, which is only supported for provider gce and gke (not %s)"
,
fileName
,
testContext
.
Provider
))
return
}
runCmdTest
(
filepath
.
Join
(
bashE2ERoot
,
fileName
))
})
}
...
...
test/e2e/util.go
View file @
feb7abca
...
...
@@ -62,6 +62,18 @@ func Failf(format string, a ...interface{}) {
Fail
(
fmt
.
Sprintf
(
format
,
a
...
),
1
)
}
func
providerIs
(
providers
...
string
)
bool
{
if
testContext
.
Provider
==
""
{
Fail
(
"testContext.Provider is not defined"
)
}
for
_
,
provider
:=
range
providers
{
if
strings
.
ToLower
(
provider
)
==
strings
.
ToLower
(
testContext
.
Provider
)
{
return
true
}
}
return
false
}
type
podCondition
func
(
pod
*
api
.
Pod
)
(
bool
,
error
)
func
waitForPodCondition
(
c
*
client
.
Client
,
ns
,
podName
,
desc
string
,
condition
podCondition
)
error
{
...
...
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