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
0eca26fa
Commit
0eca26fa
authored
Apr 27, 2015
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7358 from pmorie/fixup
Make argument order for testContainerOutputInNamespace consistent
parents
8964ad76
5f25dd24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
docker_containers.go
test/e2e/docker_containers.go
+9
-8
util.go
test/e2e/util.go
+2
-2
No files found.
test/e2e/docker_containers.go
View file @
0eca26fa
...
@@ -32,6 +32,7 @@ var _ = Describe("Docker Containers", func() {
...
@@ -32,6 +32,7 @@ var _ = Describe("Docker Containers", func() {
BeforeEach
(
func
()
{
BeforeEach
(
func
()
{
var
err
error
var
err
error
c
,
err
=
loadClient
()
c
,
err
=
loadClient
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
ns_
,
err
:=
createTestingNS
(
"containers"
,
c
)
ns_
,
err
:=
createTestingNS
(
"containers"
,
c
)
ns
=
ns_
.
Name
ns
=
ns_
.
Name
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
@@ -44,18 +45,18 @@ var _ = Describe("Docker Containers", func() {
...
@@ -44,18 +45,18 @@ var _ = Describe("Docker Containers", func() {
})
})
It
(
"should use the image defaults if command and args are blank"
,
func
()
{
It
(
"should use the image defaults if command and args are blank"
,
func
()
{
testContainerOutputInNamespace
(
ns
,
"use defaults"
,
c
,
entrypointTestPod
(),
[]
string
{
testContainerOutputInNamespace
(
"use defaults"
,
c
,
entrypointTestPod
(),
[]
string
{
"[/ep default arguments]"
,
"[/ep default arguments]"
,
})
}
,
ns
)
})
})
It
(
"should be able to override the image's default arguments (docker cmd)"
,
func
()
{
It
(
"should be able to override the image's default arguments (docker cmd)"
,
func
()
{
pod
:=
entrypointTestPod
()
pod
:=
entrypointTestPod
()
pod
.
Spec
.
Containers
[
0
]
.
Args
=
[]
string
{
"override"
,
"arguments"
}
pod
.
Spec
.
Containers
[
0
]
.
Args
=
[]
string
{
"override"
,
"arguments"
}
testContainerOutputInNamespace
(
ns
,
"override arguments"
,
c
,
pod
,
[]
string
{
testContainerOutputInNamespace
(
"override arguments"
,
c
,
pod
,
[]
string
{
"[/ep override arguments]"
,
"[/ep override arguments]"
,
})
}
,
ns
)
})
})
// Note: when you override the entrypoint, the image's arguments (docker cmd)
// Note: when you override the entrypoint, the image's arguments (docker cmd)
...
@@ -64,9 +65,9 @@ var _ = Describe("Docker Containers", func() {
...
@@ -64,9 +65,9 @@ var _ = Describe("Docker Containers", func() {
pod
:=
entrypointTestPod
()
pod
:=
entrypointTestPod
()
pod
.
Spec
.
Containers
[
0
]
.
Command
=
[]
string
{
"/ep-2"
}
pod
.
Spec
.
Containers
[
0
]
.
Command
=
[]
string
{
"/ep-2"
}
testContainerOutputInNamespace
(
ns
,
"override command"
,
c
,
pod
,
[]
string
{
testContainerOutputInNamespace
(
"override command"
,
c
,
pod
,
[]
string
{
"[/ep-2]"
,
"[/ep-2]"
,
})
}
,
ns
)
})
})
It
(
"should be able to override the image's default command and arguments"
,
func
()
{
It
(
"should be able to override the image's default command and arguments"
,
func
()
{
...
@@ -74,9 +75,9 @@ var _ = Describe("Docker Containers", func() {
...
@@ -74,9 +75,9 @@ var _ = Describe("Docker Containers", func() {
pod
.
Spec
.
Containers
[
0
]
.
Command
=
[]
string
{
"/ep-2"
}
pod
.
Spec
.
Containers
[
0
]
.
Command
=
[]
string
{
"/ep-2"
}
pod
.
Spec
.
Containers
[
0
]
.
Args
=
[]
string
{
"override"
,
"arguments"
}
pod
.
Spec
.
Containers
[
0
]
.
Args
=
[]
string
{
"override"
,
"arguments"
}
testContainerOutputInNamespace
(
ns
,
"override all"
,
c
,
pod
,
[]
string
{
testContainerOutputInNamespace
(
"override all"
,
c
,
pod
,
[]
string
{
"[/ep-2 override arguments]"
,
"[/ep-2 override arguments]"
,
})
}
,
ns
)
})
})
})
})
...
...
test/e2e/util.go
View file @
0eca26fa
...
@@ -350,13 +350,13 @@ func runKubectl(args ...string) string {
...
@@ -350,13 +350,13 @@ func runKubectl(args ...string) string {
// testContainerOutput runs testContainerOutputInNamespace with the default namespace.
// testContainerOutput runs testContainerOutputInNamespace with the default namespace.
func
testContainerOutput
(
scenarioName
string
,
c
*
client
.
Client
,
pod
*
api
.
Pod
,
expectedOutput
[]
string
)
{
func
testContainerOutput
(
scenarioName
string
,
c
*
client
.
Client
,
pod
*
api
.
Pod
,
expectedOutput
[]
string
)
{
testContainerOutputInNamespace
(
api
.
NamespaceDefault
,
scenarioName
,
c
,
pod
,
expectedOutpu
t
)
testContainerOutputInNamespace
(
scenarioName
,
c
,
pod
,
expectedOutput
,
api
.
NamespaceDefaul
t
)
}
}
// testContainerOutputInNamespace runs the given pod in the given namespace and waits
// testContainerOutputInNamespace runs the given pod in the given namespace and waits
// for the first container in the podSpec to move into the 'Success' status. It retrieves
// for the first container in the podSpec to move into the 'Success' status. It retrieves
// the container log and searches for lines of expected output.
// the container log and searches for lines of expected output.
func
testContainerOutputInNamespace
(
ns
,
scenarioName
string
,
c
*
client
.
Client
,
pod
*
api
.
Pod
,
expectedOutput
[]
string
)
{
func
testContainerOutputInNamespace
(
scenarioName
string
,
c
*
client
.
Client
,
pod
*
api
.
Pod
,
expectedOutput
[]
string
,
ns
string
)
{
By
(
fmt
.
Sprintf
(
"Creating a pod to test %v"
,
scenarioName
))
By
(
fmt
.
Sprintf
(
"Creating a pod to test %v"
,
scenarioName
))
defer
c
.
Pods
(
ns
)
.
Delete
(
pod
.
Name
)
defer
c
.
Pods
(
ns
)
.
Delete
(
pod
.
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