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
9f48f56c
Commit
9f48f56c
authored
Mar 19, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23248 from fejta/kubectl
Auto commit by PR queue bot
parents
9dd73505
f9d5c81c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
kubectl.go
test/e2e/kubectl.go
+5
-4
No files found.
test/e2e/kubectl.go
View file @
9f48f56c
...
...
@@ -73,6 +73,7 @@ const (
nginxDefaultOutput
=
"Welcome to nginx!"
simplePodPort
=
80
runJobTimeout
=
5
*
time
.
Minute
busyboxImage
=
"gcr.io/google_containers/busybox:1.24"
nginxImage
=
"gcr.io/google_containers/nginx:1.7.9"
)
...
...
@@ -462,7 +463,7 @@ var _ = KubeDescribe("Kubectl client", func() {
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
By
(
"executing a command with run and attach with stdin"
)
runOutput
:=
newKubectlCommand
(
nsFlag
,
"run"
,
"run-test"
,
"--image=
busybox"
,
"--restart=Never"
,
"--attach=true"
,
"--stdin"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
runOutput
:=
newKubectlCommand
(
nsFlag
,
"run"
,
"run-test"
,
"--image=
"
+
busyboxImage
,
"--restart=Never"
,
"--attach=true"
,
"--stdin"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
withStdinData
(
"abcd1234"
)
.
execOrDie
()
Expect
(
runOutput
)
.
To
(
ContainSubstring
(
"abcd1234"
))
...
...
@@ -470,7 +471,7 @@ var _ = KubeDescribe("Kubectl client", func() {
Expect
(
c
.
Extensions
()
.
Jobs
(
ns
)
.
Delete
(
"run-test"
,
nil
))
.
To
(
BeNil
())
By
(
"executing a command with run and attach without stdin"
)
runOutput
=
newKubectlCommand
(
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
),
"run"
,
"run-test-2"
,
"--image=
busybox"
,
"--restart=Never"
,
"--attach=true"
,
"--leave-stdin-open=true"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
runOutput
=
newKubectlCommand
(
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
),
"run"
,
"run-test-2"
,
"--image=
"
+
busyboxImage
,
"--restart=Never"
,
"--attach=true"
,
"--leave-stdin-open=true"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
withStdinData
(
"abcd1234"
)
.
execOrDie
()
Expect
(
runOutput
)
.
ToNot
(
ContainSubstring
(
"abcd1234"
))
...
...
@@ -478,7 +479,7 @@ var _ = KubeDescribe("Kubectl client", func() {
Expect
(
c
.
Extensions
()
.
Jobs
(
ns
)
.
Delete
(
"run-test-2"
,
nil
))
.
To
(
BeNil
())
By
(
"executing a command with run and attach with stdin with open stdin should remain running"
)
runOutput
=
newKubectlCommand
(
nsFlag
,
"run"
,
"run-test-3"
,
"--image=
busybox"
,
"--restart=Never"
,
"--attach=true"
,
"--leave-stdin-open=true"
,
"--stdin"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
runOutput
=
newKubectlCommand
(
nsFlag
,
"run"
,
"run-test-3"
,
"--image=
"
+
busyboxImage
,
"--restart=Never"
,
"--attach=true"
,
"--leave-stdin-open=true"
,
"--stdin"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
withStdinData
(
"abcd1234
\n
"
)
.
execOrDie
()
Expect
(
runOutput
)
.
ToNot
(
ContainSubstring
(
"stdin closed"
))
...
...
@@ -1079,7 +1080,7 @@ var _ = KubeDescribe("Kubectl client", func() {
By
(
"executing a command with run --rm and attach with stdin"
)
t
:=
time
.
NewTimer
(
runJobTimeout
)
defer
t
.
Stop
()
runOutput
:=
newKubectlCommand
(
nsFlag
,
"run"
,
jobName
,
"--image=
busybox"
,
"--rm=true"
,
"--restart=Never"
,
"--attach=true"
,
"--stdin"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
runOutput
:=
newKubectlCommand
(
nsFlag
,
"run"
,
jobName
,
"--image=
"
+
busyboxImage
,
"--rm=true"
,
"--restart=Never"
,
"--attach=true"
,
"--stdin"
,
"--"
,
"sh"
,
"-c"
,
"cat && echo 'stdin closed'"
)
.
withStdinData
(
"abcd1234"
)
.
withTimeout
(
t
.
C
)
.
execOrDie
()
...
...
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