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
71a09f6b
Commit
71a09f6b
authored
May 15, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8309 from gmarek/fix_e2e
Fix kubectl e2e test
parents
f57f3178
d65f67a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
kubectl.go
test/e2e/kubectl.go
+4
-4
util.go
test/e2e/util.go
+8
-3
No files found.
test/e2e/kubectl.go
View file @
71a09f6b
...
@@ -72,7 +72,7 @@ var _ = Describe("kubectl", func() {
...
@@ -72,7 +72,7 @@ var _ = Describe("kubectl", func() {
)
)
It
(
"should create and stop a replication controller"
,
func
()
{
It
(
"should create and stop a replication controller"
,
func
()
{
defer
cleanup
(
nautilusPath
,
updateDemoSelector
)
defer
cleanup
(
nautilusPath
,
ns
,
updateDemoSelector
)
By
(
"creating a replication controller"
)
By
(
"creating a replication controller"
)
runKubectl
(
"create"
,
"-f"
,
nautilusPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
runKubectl
(
"create"
,
"-f"
,
nautilusPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
...
@@ -80,7 +80,7 @@ var _ = Describe("kubectl", func() {
...
@@ -80,7 +80,7 @@ var _ = Describe("kubectl", func() {
})
})
It
(
"should scale a replication controller"
,
func
()
{
It
(
"should scale a replication controller"
,
func
()
{
defer
cleanup
(
nautilusPath
,
updateDemoSelector
)
defer
cleanup
(
nautilusPath
,
ns
,
updateDemoSelector
)
By
(
"creating a replication controller"
)
By
(
"creating a replication controller"
)
runKubectl
(
"create"
,
"-f"
,
nautilusPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
runKubectl
(
"create"
,
"-f"
,
nautilusPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
...
@@ -95,7 +95,7 @@ var _ = Describe("kubectl", func() {
...
@@ -95,7 +95,7 @@ var _ = Describe("kubectl", func() {
It
(
"should do a rolling update of a replication controller"
,
func
()
{
It
(
"should do a rolling update of a replication controller"
,
func
()
{
// Cleanup all resources in case we fail somewhere in the middle
// Cleanup all resources in case we fail somewhere in the middle
defer
cleanup
(
updateDemoRoot
,
updateDemoSelector
)
defer
cleanup
(
updateDemoRoot
,
ns
,
updateDemoSelector
)
By
(
"creating the initial replication controller"
)
By
(
"creating the initial replication controller"
)
runKubectl
(
"create"
,
"-f"
,
nautilusPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
runKubectl
(
"create"
,
"-f"
,
nautilusPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
...
@@ -115,7 +115,7 @@ var _ = Describe("kubectl", func() {
...
@@ -115,7 +115,7 @@ var _ = Describe("kubectl", func() {
return
return
}
}
defer
cleanup
(
guestbookPath
,
frontendSelector
,
redisMasterSelector
,
redisSlaveSelector
)
defer
cleanup
(
guestbookPath
,
ns
,
frontendSelector
,
redisMasterSelector
,
redisSlaveSelector
)
By
(
"creating all guestbook components"
)
By
(
"creating all guestbook components"
)
runKubectl
(
"create"
,
"-f"
,
guestbookPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
runKubectl
(
"create"
,
"-f"
,
guestbookPath
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
...
...
test/e2e/util.go
View file @
71a09f6b
...
@@ -212,12 +212,17 @@ func expectNoError(err error, explain ...interface{}) {
...
@@ -212,12 +212,17 @@ func expectNoError(err error, explain ...interface{}) {
ExpectWithOffset
(
1
,
err
)
.
NotTo
(
HaveOccurred
(),
explain
...
)
ExpectWithOffset
(
1
,
err
)
.
NotTo
(
HaveOccurred
(),
explain
...
)
}
}
func
cleanup
(
filePath
string
,
selectors
...
string
)
{
// Stops everything from filePath from namespace ns and checks if everything maching selectors from the given namespace is correctly stopped.
func
cleanup
(
filePath
string
,
ns
string
,
selectors
...
string
)
{
By
(
"using stop to clean up resources"
)
By
(
"using stop to clean up resources"
)
runKubectl
(
"stop"
,
"-f"
,
filePath
)
var
nsArg
string
if
ns
!=
""
{
nsArg
=
fmt
.
Sprintf
(
"--namespace=%s"
,
ns
)
}
runKubectl
(
"stop"
,
"-f"
,
filePath
,
nsArg
)
for
_
,
selector
:=
range
selectors
{
for
_
,
selector
:=
range
selectors
{
resources
:=
runKubectl
(
"get"
,
"pods,rc,se"
,
"-l"
,
selector
,
"--no-headers"
)
resources
:=
runKubectl
(
"get"
,
"pods,rc,se"
,
"-l"
,
selector
,
"--no-headers"
,
nsArg
)
if
resources
!=
""
{
if
resources
!=
""
{
Failf
(
"Resources left running after stop:
\n
%s"
,
resources
)
Failf
(
"Resources left running after stop:
\n
%s"
,
resources
)
}
}
...
...
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