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
1cfbb446
Commit
1cfbb446
authored
Oct 10, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to bring down cluster in case of failure
parent
6f84c9b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
e2e.go
hack/e2e.go
+24
-2
No files found.
hack/e2e.go
View file @
1cfbb446
...
@@ -223,6 +223,15 @@ func run(deploy deployer) error {
...
@@ -223,6 +223,15 @@ func run(deploy deployer) error {
}
}
if
*
up
{
if
*
up
{
// If we tried to bring the cluster up, make a courtesy
// attempt to bring it down so we're not leaving resources around.
//
// TODO: We should try calling deploy.Down exactly once. Though to
// stop the leaking resources for now, we want to be on the safe side
// and call it explictly in defer if the other one is not called.
if
*
down
{
defer
xmlWrap
(
"Deferred TearDown"
,
deploy
.
Down
)
}
// Start the cluster using this version.
// Start the cluster using this version.
if
err
:=
xmlWrap
(
"Up"
,
deploy
.
Up
);
err
!=
nil
{
if
err
:=
xmlWrap
(
"Up"
,
deploy
.
Up
);
err
!=
nil
{
return
fmt
.
Errorf
(
"starting e2e cluster: %s"
,
err
)
return
fmt
.
Errorf
(
"starting e2e cluster: %s"
,
err
)
...
@@ -579,6 +588,15 @@ func KubemarkTest() error {
...
@@ -579,6 +588,15 @@ func KubemarkTest() error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
// If we tried to bring the Kubemark cluster up, make a courtesy
// attempt to bring it down so we're not leaving resources around.
//
// TODO: We should try calling stop-kubemark exactly once. Though to
// stop the leaking resources for now, we want to be on the safe side
// and call it explictly in defer if the other one is not called.
defer
xmlWrap
(
"Deferred Stop kubemark"
,
func
()
error
{
return
finishRunning
(
"Stop kubemark"
,
exec
.
Command
(
"./test/kubemark/stop-kubemark.sh"
))
})
// Start new run
// Start new run
backups
:=
[]
string
{
"NUM_NODES"
,
"MASTER_SIZE"
}
backups
:=
[]
string
{
"NUM_NODES"
,
"MASTER_SIZE"
}
...
@@ -592,7 +610,9 @@ func KubemarkTest() error {
...
@@ -592,7 +610,9 @@ func KubemarkTest() error {
}
}
os
.
Setenv
(
"NUM_NODES"
,
os
.
Getenv
(
"KUBEMARK_NUM_NODES"
))
os
.
Setenv
(
"NUM_NODES"
,
os
.
Getenv
(
"KUBEMARK_NUM_NODES"
))
os
.
Setenv
(
"MASTER_SIZE"
,
os
.
Getenv
(
"KUBEMARK_MASTER_SIZE"
))
os
.
Setenv
(
"MASTER_SIZE"
,
os
.
Getenv
(
"KUBEMARK_MASTER_SIZE"
))
err
=
finishRunning
(
"Start Kubemark"
,
exec
.
Command
(
"./test/kubemark/start-kubemark.sh"
))
err
=
xmlWrap
(
"Start kubemark"
,
func
()
error
{
return
finishRunning
(
"Start kubemark"
,
exec
.
Command
(
"./test/kubemark/start-kubemark.sh"
))
})
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -609,7 +629,9 @@ func KubemarkTest() error {
...
@@ -609,7 +629,9 @@ func KubemarkTest() error {
return
err
return
err
}
}
err
=
finishRunning
(
"Stop kubemark"
,
exec
.
Command
(
"./test/kubemark/stop-kubemark.sh"
))
err
=
xmlWrap
(
"Stop kubemark"
,
func
()
error
{
return
finishRunning
(
"Stop kubemark"
,
exec
.
Command
(
"./test/kubemark/stop-kubemark.sh"
))
})
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
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