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
f6c5817b
Commit
f6c5817b
authored
Dec 28, 2018
by
Michelle Au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add e2e test for removing the subpath directory
parent
a2306e8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
subpath.go
test/e2e/storage/testsuites/subpath.go
+26
-1
No files found.
test/e2e/storage/testsuites/subpath.go
View file @
f6c5817b
...
@@ -22,7 +22,7 @@ import (
...
@@ -22,7 +22,7 @@ import (
"regexp"
"regexp"
"strings"
"strings"
"k8s.io/api/core/v1"
v1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/wait"
...
@@ -361,6 +361,31 @@ func testSubPath(input *subPathTestInput) {
...
@@ -361,6 +361,31 @@ func testSubPath(input *subPathTestInput) {
testReadFile
(
input
.
f
,
input
.
filePathInSubpath
,
input
.
pod
,
0
)
testReadFile
(
input
.
f
,
input
.
filePathInSubpath
,
input
.
pod
,
0
)
})
})
It
(
"should be able to unmount after the subpath directory is deleted"
,
func
()
{
// Change volume container to busybox so we can exec later
input
.
pod
.
Spec
.
Containers
[
1
]
.
Image
=
imageutils
.
GetE2EImage
(
imageutils
.
BusyBox
)
input
.
pod
.
Spec
.
Containers
[
1
]
.
Command
=
[]
string
{
"/bin/sh"
,
"-ec"
,
"sleep 100000"
}
By
(
fmt
.
Sprintf
(
"Creating pod %s"
,
input
.
pod
.
Name
))
pod
,
err
:=
input
.
f
.
ClientSet
.
CoreV1
()
.
Pods
(
input
.
f
.
Namespace
.
Name
)
.
Create
(
input
.
pod
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while creating pod"
)
defer
func
()
{
By
(
fmt
.
Sprintf
(
"Deleting pod %s"
,
pod
.
Name
))
framework
.
DeletePodWithWait
(
input
.
f
,
input
.
f
.
ClientSet
,
pod
)
}()
// Wait for pod to be running
err
=
framework
.
WaitForPodRunningInNamespace
(
input
.
f
.
ClientSet
,
pod
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while waiting for pod to be running"
)
// Exec into container that mounted the volume, delete subpath directory
rmCmd
:=
fmt
.
Sprintf
(
"rm -rf %s"
,
input
.
subPathDir
)
_
,
err
=
podContainerExec
(
pod
,
1
,
rmCmd
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while removing subpath directory"
)
// Delete pod (from defer) and wait for it to be successfully deleted
})
// TODO: add a test case for the same disk with two partitions
// TODO: add a test case for the same disk with two partitions
}
}
...
...
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