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
6d4e457f
Commit
6d4e457f
authored
Nov 29, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collect serial output when test fails in node e2e.
parent
a2d5df40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
remote.go
test/e2e_node/remote/remote.go
+13
-0
run_remote.go
test/e2e_node/runner/remote/run_remote.go
+15
-1
No files found.
test/e2e_node/remote/remote.go
View file @
6d4e457f
...
...
@@ -350,6 +350,19 @@ func getTestArtifacts(host, testDir string) error {
return
nil
}
// WriteLog is a temporary function to make it possible to write log
// in the runner. This is used to collect serial console log.
// TODO(random-liu): Use the log-dump script in cluster e2e.
func
WriteLog
(
host
,
filename
,
content
string
)
error
{
f
,
err
:=
os
.
Create
(
filepath
.
Join
(
*
resultsDir
,
host
,
filename
))
if
err
!=
nil
{
return
err
}
defer
f
.
Close
()
_
,
err
=
f
.
WriteString
(
content
)
return
err
}
// getSSHCommand handles proper quoting so that multiple commands are executed in the same shell over ssh
func
getSSHCommand
(
sep
string
,
args
...
string
)
string
{
return
fmt
.
Sprintf
(
"'%s'"
,
strings
.
Join
(
args
,
sep
))
...
...
test/e2e_node/runner/remote/run_remote.go
View file @
6d4e457f
...
...
@@ -449,7 +449,21 @@ func testImage(imageConfig *internalGCEImage, junitFilePrefix string) *TestResul
// Only delete the files if we are keeping the instance and want it cleaned up.
// If we are going to delete the instance, don't bother with cleaning up the files
deleteFiles
:=
!*
deleteInstances
&&
*
cleanup
return
testHost
(
host
,
deleteFiles
,
junitFilePrefix
,
*
setupNode
,
ginkgoFlagsStr
)
result
:=
testHost
(
host
,
deleteFiles
,
junitFilePrefix
,
*
setupNode
,
ginkgoFlagsStr
)
// This is a temporary solution to collect serial node serial log. Only port 1 contains useful information.
// TODO(random-liu): Extract out and unify log collection logic with cluste e2e.
serialPortOutput
,
err
:=
computeService
.
Instances
.
GetSerialPortOutput
(
*
project
,
*
zone
,
host
)
.
Port
(
1
)
.
Do
()
if
err
!=
nil
{
glog
.
Errorf
(
"Failed to collect serial output from node %q: %v"
,
host
,
err
)
}
else
{
logFilename
:=
"serial-1.log"
err
:=
remote
.
WriteLog
(
host
,
logFilename
,
serialPortOutput
.
Contents
)
if
err
!=
nil
{
glog
.
Errorf
(
"Failed to write serial output from node %q to %q: %v"
,
host
,
logFilename
,
err
)
}
}
return
result
}
// Provision a gce instance using image
...
...
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