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
cfd53d6d
Unverified
Commit
cfd53d6d
authored
Nov 05, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70263 from oomichi/remove-test
Remove subPath tests from host_path.go
parents
b70ccc52
01d0dc36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
95 deletions
+0
-95
host_path.go
test/e2e/common/host_path.go
+0
-95
No files found.
test/e2e/common/host_path.go
View file @
cfd53d6d
...
@@ -116,101 +116,6 @@ var _ = Describe("[sig-storage] HostPath", func() {
...
@@ -116,101 +116,6 @@ var _ = Describe("[sig-storage] HostPath", func() {
"content of file
\"
"
+
filePathInReader
+
"
\"
: mount-tester new file"
,
"content of file
\"
"
+
filePathInReader
+
"
\"
: mount-tester new file"
,
})
})
})
})
It
(
"should support existing directory subPath"
,
func
()
{
framework
.
SkipUnlessSSHKeyPresent
()
subPath
:=
"sub-path"
fileName
:=
"test-file"
retryDuration
:=
180
filePathInWriter
:=
path
.
Join
(
volumePath
,
fileName
)
filePathInReader
:=
path
.
Join
(
volumePath
,
subPath
,
fileName
)
source
:=
&
v1
.
HostPathVolumeSource
{
Path
:
"/tmp"
,
}
pod
:=
testPodWithHostVol
(
volumePath
,
source
)
nodeList
:=
framework
.
GetReadySchedulableNodesOrDie
(
f
.
ClientSet
)
pod
.
Spec
.
NodeName
=
nodeList
.
Items
[
0
]
.
Name
// Create the subPath directory on the host
existing
:=
path
.
Join
(
source
.
Path
,
subPath
)
nodeIP
,
err
:=
framework
.
GetNodeExternalIP
(
&
nodeList
.
Items
[
0
])
if
err
!=
nil
{
nodeIP
,
err
=
framework
.
GetNodeInternalIP
(
&
nodeList
.
Items
[
0
])
}
framework
.
ExpectNoError
(
err
)
result
,
err
:=
framework
.
SSH
(
fmt
.
Sprintf
(
"mkdir -p %s"
,
existing
),
nodeIP
,
framework
.
TestContext
.
Provider
)
framework
.
LogSSHResult
(
result
)
framework
.
ExpectNoError
(
err
)
if
result
.
Code
!=
0
{
framework
.
Failf
(
"mkdir returned non-zero"
)
}
// Write the file in the subPath from container 0
container
:=
&
pod
.
Spec
.
Containers
[
0
]
container
.
VolumeMounts
[
0
]
.
SubPath
=
subPath
container
.
Args
=
[]
string
{
fmt
.
Sprintf
(
"--new_file_0644=%v"
,
filePathInWriter
),
fmt
.
Sprintf
(
"--file_mode=%v"
,
filePathInWriter
),
}
// Read it from outside the subPath from container 1
pod
.
Spec
.
Containers
[
1
]
.
Args
=
[]
string
{
fmt
.
Sprintf
(
"--file_content_in_loop=%v"
,
filePathInReader
),
fmt
.
Sprintf
(
"--retry_time=%d"
,
retryDuration
),
}
f
.
TestContainerOutput
(
"hostPath subPath"
,
pod
,
1
,
[]
string
{
"content of file
\"
"
+
filePathInReader
+
"
\"
: mount-tester new file"
,
})
})
// TODO consolidate common code of this test and above
It
(
"should support existing single file subPath"
,
func
()
{
framework
.
SkipUnlessSSHKeyPresent
()
subPath
:=
"sub-path-test-file"
retryDuration
:=
180
filePathInReader
:=
path
.
Join
(
volumePath
,
subPath
)
source
:=
&
v1
.
HostPathVolumeSource
{
Path
:
"/tmp"
,
}
pod
:=
testPodWithHostVol
(
volumePath
,
source
)
nodeList
:=
framework
.
GetReadySchedulableNodesOrDie
(
f
.
ClientSet
)
pod
.
Spec
.
NodeName
=
nodeList
.
Items
[
0
]
.
Name
// Create the subPath file on the host
existing
:=
path
.
Join
(
source
.
Path
,
subPath
)
nodeIP
,
err
:=
framework
.
GetNodeExternalIP
(
&
nodeList
.
Items
[
0
])
if
err
!=
nil
{
nodeIP
,
err
=
framework
.
GetNodeInternalIP
(
&
nodeList
.
Items
[
0
])
}
framework
.
ExpectNoError
(
err
)
result
,
err
:=
framework
.
SSH
(
fmt
.
Sprintf
(
"echo
\"
mount-tester new file
\"
> %s"
,
existing
),
nodeIP
,
framework
.
TestContext
.
Provider
)
framework
.
LogSSHResult
(
result
)
framework
.
ExpectNoError
(
err
)
if
result
.
Code
!=
0
{
framework
.
Failf
(
"echo returned non-zero"
)
}
// Mount the file to the subPath in container 0
container
:=
&
pod
.
Spec
.
Containers
[
0
]
container
.
VolumeMounts
[
0
]
.
SubPath
=
subPath
// Read it from outside the subPath from container 1
pod
.
Spec
.
Containers
[
1
]
.
Args
=
[]
string
{
fmt
.
Sprintf
(
"--file_content_in_loop=%v"
,
filePathInReader
),
fmt
.
Sprintf
(
"--retry_time=%d"
,
retryDuration
),
}
f
.
TestContainerOutput
(
"hostPath subPath"
,
pod
,
1
,
[]
string
{
"content of file
\"
"
+
filePathInReader
+
"
\"
: mount-tester new file"
,
})
})
})
})
//These constants are borrowed from the other test.
//These constants are borrowed from the other test.
...
...
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