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
35aad159
Commit
35aad159
authored
Aug 18, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove fatal error in e2e_node_suite_test.go
parent
811fd94e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
e2e_node_suite_test.go
test/e2e_node/e2e_node_suite_test.go
+7
-15
No files found.
test/e2e_node/e2e_node_suite_test.go
View file @
35aad159
...
@@ -96,9 +96,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
...
@@ -96,9 +96,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
// Initialize node name here, so that the following code can get right node name.
// Initialize node name here, so that the following code can get right node name.
if
framework
.
TestContext
.
NodeName
==
""
{
if
framework
.
TestContext
.
NodeName
==
""
{
hostname
,
err
:=
os
.
Hostname
()
hostname
,
err
:=
os
.
Hostname
()
if
err
!=
nil
{
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"should be able to get node name"
)
glog
.
Fatalf
(
"Could not get node name: %v"
,
err
)
}
framework
.
TestContext
.
NodeName
=
hostname
framework
.
TestContext
.
NodeName
=
hostname
}
}
// Pre-pull the images tests depend on so we can fail immediately if there is an image pull issue
// Pre-pull the images tests depend on so we can fail immediately if there is an image pull issue
...
@@ -116,9 +114,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
...
@@ -116,9 +114,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
if
*
startServices
{
if
*
startServices
{
e2es
=
NewE2EServices
()
e2es
=
NewE2EServices
()
if
err
:=
e2es
.
Start
();
err
!=
nil
{
Expect
(
e2es
.
Start
())
.
To
(
Succeed
(),
"should be able to start node services."
)
glog
.
Fatalf
(
"Unable to start node services: %v"
,
err
)
}
glog
.
Infof
(
"Node services started. Running tests..."
)
glog
.
Infof
(
"Node services started. Running tests..."
)
}
else
{
}
else
{
glog
.
Infof
(
"Running tests without starting services."
)
glog
.
Infof
(
"Running tests without starting services."
)
...
@@ -132,16 +128,13 @@ var _ = SynchronizedBeforeSuite(func() []byte {
...
@@ -132,16 +128,13 @@ var _ = SynchronizedBeforeSuite(func() []byte {
commontest
.
CurrentSuite
=
commontest
.
NodeE2E
commontest
.
CurrentSuite
=
commontest
.
NodeE2E
data
,
err
:=
json
.
Marshal
(
&
framework
.
TestContext
.
NodeTestContextType
)
data
,
err
:=
json
.
Marshal
(
&
framework
.
TestContext
.
NodeTestContextType
)
if
err
!=
nil
{
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"should be able to serialize node test context."
)
glog
.
Fatalf
(
"Failed to serialize node test context: %v"
,
err
)
}
return
data
return
data
},
func
(
data
[]
byte
)
{
},
func
(
data
[]
byte
)
{
// The node test context is updated in the first function, update it on every test node.
// The node test context is updated in the first function, update it on every test node.
err
:=
json
.
Unmarshal
(
data
,
&
framework
.
TestContext
.
NodeTestContextType
)
err
:=
json
.
Unmarshal
(
data
,
&
framework
.
TestContext
.
NodeTestContextType
)
if
err
!=
nil
{
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"should be able to deserialize node test context."
)
glog
.
Fatalf
(
"Failed to deserialize node test context: %v"
,
err
)
}
})
})
// Tear down the kubelet on the node
// Tear down the kubelet on the node
...
@@ -164,9 +157,8 @@ func maskLocksmithdOnCoreos() {
...
@@ -164,9 +157,8 @@ func maskLocksmithdOnCoreos() {
return
return
}
}
if
bytes
.
Contains
(
data
,
[]
byte
(
"ID=coreos"
))
{
if
bytes
.
Contains
(
data
,
[]
byte
(
"ID=coreos"
))
{
if
output
,
err
:=
exec
.
Command
(
"sudo"
,
"systemctl"
,
"mask"
,
"--now"
,
"locksmithd"
)
.
CombinedOutput
();
err
!=
nil
{
output
,
err
:=
exec
.
Command
(
"sudo"
,
"systemctl"
,
"mask"
,
"--now"
,
"locksmithd"
)
.
CombinedOutput
()
glog
.
Fatalf
(
"Could not mask locksmithd: %v, output: %q"
,
err
,
string
(
output
))
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
fmt
.
Sprintf
(
"should be able to mask locksmithd - output: %q"
,
string
(
output
)))
}
glog
.
Infof
(
"Locksmithd is masked successfully"
)
glog
.
Infof
(
"Locksmithd is masked successfully"
)
}
}
}
}
...
...
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