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
4bbd4044
Commit
4bbd4044
authored
Oct 31, 2016
by
shashidharatd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ConfigMaps to k8s upgrade tests
parent
7380c1fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
cluster_upgrade.go
test/e2e/cluster_upgrade.go
+42
-0
configmap.go
test/e2e/common/configmap.go
+10
-1
No files found.
test/e2e/cluster_upgrade.go
View file @
4bbd4044
...
@@ -49,6 +49,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
...
@@ -49,6 +49,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
// Close over f.
// Close over f.
testServiceRemainsUp
(
f
,
sem
)
testServiceRemainsUp
(
f
,
sem
)
testSecretsDuringUpgrade
(
f
,
sem
)
testSecretsDuringUpgrade
(
f
,
sem
)
testConfigMapsDuringUpgrade
(
f
,
sem
)
})
})
cm
.
Do
()
cm
.
Do
()
})
})
...
@@ -66,6 +67,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
...
@@ -66,6 +67,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
// Close over f.
// Close over f.
testServiceUpBeforeAndAfter
(
f
,
sem
)
testServiceUpBeforeAndAfter
(
f
,
sem
)
testSecretsBeforeAndAfterUpgrade
(
f
,
sem
)
testSecretsBeforeAndAfterUpgrade
(
f
,
sem
)
testConfigMapsBeforeAndAfterUpgrade
(
f
,
sem
)
})
})
cm
.
Do
()
cm
.
Do
()
})
})
...
@@ -81,6 +83,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
...
@@ -81,6 +83,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
// Close over f.
// Close over f.
testServiceRemainsUp
(
f
,
sem
)
testServiceRemainsUp
(
f
,
sem
)
testSecretsDuringUpgrade
(
f
,
sem
)
testSecretsDuringUpgrade
(
f
,
sem
)
testConfigMapsDuringUpgrade
(
f
,
sem
)
})
})
cm
.
Do
()
cm
.
Do
()
})
})
...
@@ -100,6 +103,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
...
@@ -100,6 +103,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
// Close over f.
// Close over f.
testServiceUpBeforeAndAfter
(
f
,
sem
)
testServiceUpBeforeAndAfter
(
f
,
sem
)
testSecretsBeforeAndAfterUpgrade
(
f
,
sem
)
testSecretsBeforeAndAfterUpgrade
(
f
,
sem
)
testConfigMapsBeforeAndAfterUpgrade
(
f
,
sem
)
})
})
cm
.
Do
()
cm
.
Do
()
})
})
...
@@ -117,6 +121,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
...
@@ -117,6 +121,7 @@ var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() {
// Close over f.
// Close over f.
testServiceRemainsUp
(
f
,
sem
)
testServiceRemainsUp
(
f
,
sem
)
testSecretsDuringUpgrade
(
f
,
sem
)
testSecretsDuringUpgrade
(
f
,
sem
)
testConfigMapsDuringUpgrade
(
f
,
sem
)
})
})
cm
.
Do
()
cm
.
Do
()
})
})
...
@@ -270,3 +275,40 @@ func testSecrets(f *framework.Framework, sem *chaosmonkey.Semaphore, testDuringD
...
@@ -270,3 +275,40 @@ func testSecrets(f *framework.Framework, sem *chaosmonkey.Semaphore, testDuringD
// Teardown
// Teardown
}
}
func
testConfigMapsBeforeAndAfterUpgrade
(
f
*
framework
.
Framework
,
sem
*
chaosmonkey
.
Semaphore
)
{
testConfigMaps
(
f
,
sem
,
false
)
}
func
testConfigMapsDuringUpgrade
(
f
*
framework
.
Framework
,
sem
*
chaosmonkey
.
Semaphore
)
{
testConfigMaps
(
f
,
sem
,
true
)
}
func
testConfigMaps
(
f
*
framework
.
Framework
,
sem
*
chaosmonkey
.
Semaphore
,
testDuringDisruption
bool
)
{
// Setup
pod
,
expectedOutput
:=
common
.
DoConfigMapE2EWithoutMappingsSetup
(
f
,
0
,
0
,
nil
)
// Validate
By
(
"consume config-maps before upgrade"
)
common
.
DoConfigMapE2EWithoutMappingsValidate
(
f
,
pod
,
expectedOutput
)
sem
.
Ready
()
if
testDuringDisruption
{
// Continuously validate
wait
.
Until
(
func
()
{
By
(
"consume config-maps during upgrade"
)
common
.
DoConfigMapE2EWithoutMappingsValidate
(
f
,
pod
,
expectedOutput
)
},
framework
.
Poll
,
sem
.
StopCh
)
}
else
{
// Block until chaosmonkey is done
By
(
"waiting for upgrade to finish without consuming config-maps"
)
<-
sem
.
StopCh
}
// Validate after upgrade
By
(
"consume config-maps after upgrade"
)
common
.
DoConfigMapE2EWithoutMappingsValidate
(
f
,
pod
,
expectedOutput
)
// Teardown
}
test/e2e/common/configmap.go
View file @
4bbd4044
...
@@ -278,7 +278,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap {
...
@@ -278,7 +278,7 @@ func newConfigMap(f *framework.Framework, name string) *api.ConfigMap {
}
}
}
}
func
doConfigMapE2EWithoutMappings
(
f
*
framework
.
Framework
,
uid
,
fsGroup
int64
,
defaultMode
*
int32
)
{
func
DoConfigMapE2EWithoutMappingsSetup
(
f
*
framework
.
Framework
,
uid
,
fsGroup
int64
,
defaultMode
*
int32
)
(
*
api
.
Pod
,
[]
string
)
{
var
(
var
(
name
=
"configmap-test-volume-"
+
string
(
uuid
.
NewUUID
())
name
=
"configmap-test-volume-"
+
string
(
uuid
.
NewUUID
())
volumeName
=
"configmap-volume"
volumeName
=
"configmap-volume"
...
@@ -352,8 +352,17 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64, d
...
@@ -352,8 +352,17 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, uid, fsGroup int64, d
modeString
:=
fmt
.
Sprintf
(
"%v"
,
os
.
FileMode
(
*
defaultMode
))
modeString
:=
fmt
.
Sprintf
(
"%v"
,
os
.
FileMode
(
*
defaultMode
))
output
=
append
(
output
,
"mode of file
\"
/etc/configmap-volume/data-1
\"
: "
+
modeString
)
output
=
append
(
output
,
"mode of file
\"
/etc/configmap-volume/data-1
\"
: "
+
modeString
)
}
}
return
pod
,
output
}
func
DoConfigMapE2EWithoutMappingsValidate
(
f
*
framework
.
Framework
,
pod
*
api
.
Pod
,
output
[]
string
)
{
f
.
TestContainerOutput
(
"consume configMaps"
,
pod
,
0
,
output
)
f
.
TestContainerOutput
(
"consume configMaps"
,
pod
,
0
,
output
)
}
func
doConfigMapE2EWithoutMappings
(
f
*
framework
.
Framework
,
uid
,
fsGroup
int64
,
defaultMode
*
int32
)
{
pod
,
output
:=
DoConfigMapE2EWithoutMappingsSetup
(
f
,
uid
,
fsGroup
,
defaultMode
)
DoConfigMapE2EWithoutMappingsValidate
(
f
,
pod
,
output
)
}
}
func
doConfigMapE2EWithMappings
(
f
*
framework
.
Framework
,
uid
,
fsGroup
int64
,
itemMode
*
int32
)
{
func
doConfigMapE2EWithMappings
(
f
*
framework
.
Framework
,
uid
,
fsGroup
int64
,
itemMode
*
int32
)
{
...
...
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