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