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
a779aca1
Commit
a779aca1
authored
Nov 07, 2016
by
shashidharatd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle comments on upgrade tests
parent
a4f614f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
cluster_upgrade.go
test/e2e/cluster_upgrade.go
+5
-4
job.go
test/e2e/job.go
+13
-7
No files found.
test/e2e/cluster_upgrade.go
View file @
a779aca1
...
...
@@ -38,7 +38,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
f
:=
framework
.
NewDefaultFramework
(
"cluster-upgrade"
)
framework
.
KubeDescribe
(
"master upgrade"
,
func
()
{
It
(
"should maintain
responsive services
[Feature:MasterUpgrade]"
,
func
()
{
It
(
"should maintain
functioning cluster during upgrade
[Feature:MasterUpgrade]"
,
func
()
{
cm
:=
chaosmonkey
.
New
(
func
()
{
v
,
err
:=
realVersion
(
framework
.
TestContext
.
UpgradeTarget
)
framework
.
ExpectNoError
(
err
)
...
...
@@ -78,7 +78,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
cm
.
Do
()
})
It
(
"should maintain
responsive services
[Feature:ExperimentalNodeUpgrade]"
,
func
()
{
It
(
"should maintain
functioning cluster during upgrade
[Feature:ExperimentalNodeUpgrade]"
,
func
()
{
cm
:=
chaosmonkey
.
New
(
func
()
{
v
,
err
:=
realVersion
(
framework
.
TestContext
.
UpgradeTarget
)
framework
.
ExpectNoError
(
err
)
...
...
@@ -120,7 +120,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
cm
.
Do
()
})
It
(
"should maintain
responsive services
[Feature:ExperimentalClusterUpgrade]"
,
func
()
{
It
(
"should maintain
functioning cluster during upgrade
[Feature:ExperimentalClusterUpgrade]"
,
func
()
{
cm
:=
chaosmonkey
.
New
(
func
()
{
v
,
err
:=
realVersion
(
framework
.
TestContext
.
UpgradeTarget
)
framework
.
ExpectNoError
(
err
)
...
...
@@ -424,7 +424,7 @@ func testJobs(f *framework.Framework, sem *chaosmonkey.Semaphore, testDuringDisr
// Setup
By
(
"setup job"
)
job
:=
TestJobsSetup
(
"randomlySucceedOrFail"
,
"rand-non-local"
,
api
.
RestartPolicyNever
,
parallelism
,
completions
)
job
:=
TestJobsSetup
(
f
,
"randomlySucceedOrFail"
,
"rand-non-local"
,
api
.
RestartPolicyNever
,
parallelism
,
completions
)
// Validate
By
(
"validate job before upgrade"
)
TestJobsValidate
(
f
,
job
,
completions
)
...
...
@@ -448,4 +448,5 @@ func testJobs(f *framework.Framework, sem *chaosmonkey.Semaphore, testDuringDisr
TestJobsValidate
(
f
,
job
,
completions
)
// Teardown
TestJobsTeardown
(
f
,
job
)
}
test/e2e/job.go
View file @
a779aca1
...
...
@@ -333,25 +333,31 @@ func newBool(val bool) *bool {
return
p
}
func
TestJobsSetup
(
behavior
,
name
string
,
rPol
api
.
RestartPolicy
,
parallelism
,
completions
int32
)
*
batch
.
Job
{
return
newTestJob
(
behavior
,
name
,
rPol
,
parallelism
,
completions
)
}
func
TestJobsSetup
(
f
*
framework
.
Framework
,
behavior
,
name
string
,
rPol
api
.
RestartPolicy
,
parallelism
,
completions
int32
)
*
batch
.
Job
{
job
:=
newTestJob
(
behavior
,
name
,
rPol
,
parallelism
,
completions
)
func
TestJobsValidate
(
f
*
framework
.
Framework
,
job
*
batch
.
Job
,
completions
int32
)
{
By
(
"Creating a job"
)
job
,
err
:=
createJob
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
job
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
return
job
}
func
TestJobsValidate
(
f
*
framework
.
Framework
,
job
*
batch
.
Job
,
completions
int32
)
{
By
(
"Ensuring job reaches completions"
)
err
=
waitForJobFinish
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
job
.
Name
,
completions
)
err
:
=
waitForJobFinish
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
job
.
Name
,
completions
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
func
TestJobsTeardown
(
f
*
framework
.
Framework
,
job
*
batch
.
Job
)
{
By
(
"Delete the job"
)
err
=
deleteJob
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
job
.
ObjectMeta
.
Name
)
err
:
=
deleteJob
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
job
.
ObjectMeta
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
func
TestJobs
(
f
*
framework
.
Framework
,
behavior
,
name
string
,
rPol
api
.
RestartPolicy
,
parallelism
,
completions
int32
)
{
job
:=
TestJobsSetup
(
behavior
,
name
,
rPol
,
parallelism
,
completions
)
job
:=
TestJobsSetup
(
f
,
behavior
,
name
,
rPol
,
parallelism
,
completions
)
TestJobsValidate
(
f
,
job
,
completions
)
TestJobsTeardown
(
f
,
job
)
}
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