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
0d500921
Commit
0d500921
authored
Oct 04, 2016
by
MrHohn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examine output format before return, fail the test instead of panic
parent
649f6dbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
service.go
test/e2e/service.go
+6
-3
No files found.
test/e2e/service.go
View file @
0d500921
...
@@ -2347,7 +2347,10 @@ func execSourceipTest(f *framework.Framework, c *client.Client, ns, nodeName, se
...
@@ -2347,7 +2347,10 @@ func execSourceipTest(f *framework.Framework, c *client.Client, ns, nodeName, se
// the stdout return from RunHostCmd seems to come with "\n", so TrimSpace is needed
// the stdout return from RunHostCmd seems to come with "\n", so TrimSpace is needed
// desired stdout in this format: client_address=x.x.x.x
// desired stdout in this format: client_address=x.x.x.x
outputs
:=
strings
.
Split
(
strings
.
TrimSpace
(
stdout
),
"="
)
outputs
:=
strings
.
Split
(
strings
.
TrimSpace
(
stdout
),
"="
)
sourceIp
:=
outputs
[
1
]
if
len
(
outputs
)
!=
2
{
// fail the test if output format is unexpected
return
execPodIp
,
sourceIp
framework
.
Failf
(
"exec pod returned unexpected stdout format: [%v]
\n
"
,
stdout
)
return
execPodIp
,
""
}
return
execPodIp
,
outputs
[
1
]
}
}
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