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
44be42c1
Commit
44be42c1
authored
Sep 17, 2018
by
David Zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include PV wait confirmation for Disruptive PV tests
parent
36f658aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
pv_util.go
test/e2e/framework/pv_util.go
+3
-0
generic_persistent_volume-disruptive.go
test/e2e/storage/generic_persistent_volume-disruptive.go
+5
-4
nfs_persistent_volume-disruptive.go
test/e2e/storage/nfs_persistent_volume-disruptive.go
+6
-3
No files found.
test/e2e/framework/pv_util.go
View file @
44be42c1
...
...
@@ -507,6 +507,9 @@ func testPodSuccessOrFail(c clientset.Interface, ns string, pod *v1.Pod) error {
// Deletes the passed-in pod and waits for the pod to be terminated. Resilient to the pod
// not existing.
func
DeletePodWithWait
(
f
*
Framework
,
c
clientset
.
Interface
,
pod
*
v1
.
Pod
)
error
{
if
pod
==
nil
{
return
nil
}
return
DeletePodWithWaitByName
(
f
,
c
,
pod
.
GetName
(),
pod
.
GetNamespace
())
}
...
...
test/e2e/storage/generic_persistent_volume-disruptive.go
View file @
44be42c1
...
...
@@ -61,10 +61,11 @@ var _ = utils.SIGDescribe("GenericPersistentVolume[Disruptive]", func() {
var
(
clientPod
*
v1
.
Pod
pvc
*
v1
.
PersistentVolumeClaim
pv
*
v1
.
PersistentVolume
)
BeforeEach
(
func
()
{
framework
.
Logf
(
"Initializing pod and pvcs for test"
)
clientPod
,
pvc
=
createPodPVCFromSC
(
f
,
c
,
ns
)
clientPod
,
pvc
,
pv
=
createPodPVCFromSC
(
f
,
c
,
ns
)
})
for
_
,
test
:=
range
disruptiveTestTable
{
func
(
t
disruptiveTest
)
{
...
...
@@ -76,13 +77,13 @@ var _ = utils.SIGDescribe("GenericPersistentVolume[Disruptive]", func() {
}
AfterEach
(
func
()
{
framework
.
Logf
(
"Tearing down test spec"
)
tearDownTestCase
(
c
,
f
,
ns
,
clientPod
,
pvc
,
nil
)
tearDownTestCase
(
c
,
f
,
ns
,
clientPod
,
pvc
,
pv
,
false
)
pvc
,
clientPod
=
nil
,
nil
})
})
})
func
createPodPVCFromSC
(
f
*
framework
.
Framework
,
c
clientset
.
Interface
,
ns
string
)
(
*
v1
.
Pod
,
*
v1
.
PersistentVolumeClaim
)
{
func
createPodPVCFromSC
(
f
*
framework
.
Framework
,
c
clientset
.
Interface
,
ns
string
)
(
*
v1
.
Pod
,
*
v1
.
PersistentVolumeClaim
,
*
v1
.
PersistentVolume
)
{
var
err
error
test
:=
storageClassTest
{
name
:
"default"
,
...
...
@@ -99,5 +100,5 @@ func createPodPVCFromSC(f *framework.Framework, c clientset.Interface, ns string
By
(
"Creating a pod with dynamically provisioned volume"
)
pod
,
err
:=
framework
.
CreateNginxPod
(
c
,
ns
,
nil
,
pvcClaims
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"While creating pods for kubelet restart test"
)
return
pod
,
pvc
return
pod
,
pvc
,
pvs
[
0
]
}
test/e2e/storage/nfs_persistent_volume-disruptive.go
View file @
44be42c1
...
...
@@ -208,7 +208,7 @@ var _ = utils.SIGDescribe("NFSPersistentVolumes[Disruptive][Flaky]", func() {
AfterEach
(
func
()
{
framework
.
Logf
(
"Tearing down test spec"
)
tearDownTestCase
(
c
,
f
,
ns
,
clientPod
,
pvc
,
pv
)
tearDownTestCase
(
c
,
f
,
ns
,
clientPod
,
pvc
,
pv
,
true
/* force PV delete */
)
pv
,
pvc
,
clientPod
=
nil
,
nil
,
nil
})
...
...
@@ -277,11 +277,14 @@ func initTestCase(f *framework.Framework, c clientset.Interface, pvConfig framew
}
// tearDownTestCase destroy resources created by initTestCase.
func
tearDownTestCase
(
c
clientset
.
Interface
,
f
*
framework
.
Framework
,
ns
string
,
client
*
v1
.
Pod
,
pvc
*
v1
.
PersistentVolumeClaim
,
pv
*
v1
.
PersistentVolume
)
{
func
tearDownTestCase
(
c
clientset
.
Interface
,
f
*
framework
.
Framework
,
ns
string
,
client
*
v1
.
Pod
,
pvc
*
v1
.
PersistentVolumeClaim
,
pv
*
v1
.
PersistentVolume
,
forceDeletePV
bool
)
{
// Ignore deletion errors. Failing on them will interrupt test cleanup.
framework
.
DeletePodWithWait
(
f
,
c
,
client
)
framework
.
DeletePersistentVolumeClaim
(
c
,
pvc
.
Name
,
ns
)
if
pv
!=
nil
{
if
forceDeletePV
{
framework
.
DeletePersistentVolume
(
c
,
pv
.
Name
)
return
}
err
:=
framework
.
WaitForPersistentVolumeDeleted
(
c
,
pv
.
Name
,
5
*
time
.
Second
,
5
*
time
.
Minute
)
framework
.
ExpectNoError
(
err
,
"Persistent Volume %v not deleted by dynamic provisioner"
,
pv
.
Name
)
}
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