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
c72fc500
Unverified
Commit
c72fc500
authored
Dec 04, 2017
by
Anirudh Ramanathan
Committed by
GitHub
Dec 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix for the network partition tests"
parent
0d22ddc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
24 deletions
+3
-24
networking_utils.go
test/e2e/framework/networking_utils.go
+3
-7
util.go
test/e2e/framework/util.go
+0
-17
No files found.
test/e2e/framework/networking_utils.go
View file @
c72fc500
...
@@ -935,9 +935,7 @@ func TestHitNodesFromOutsideWithCount(externalIP string, httpPort int32, timeout
...
@@ -935,9 +935,7 @@ func TestHitNodesFromOutsideWithCount(externalIP string, httpPort int32, timeout
// This function executes commands on a node so it will work only for some
// This function executes commands on a node so it will work only for some
// environments.
// environments.
func
TestUnderTemporaryNetworkFailure
(
c
clientset
.
Interface
,
ns
string
,
node
*
v1
.
Node
,
testFunc
func
())
{
func
TestUnderTemporaryNetworkFailure
(
c
clientset
.
Interface
,
ns
string
,
node
*
v1
.
Node
,
testFunc
func
())
{
externalIP
:=
GetNodeExternalIP
(
node
)
host
:=
GetNodeExternalIP
(
node
)
internalIP
:=
GetNodeInternalIP
(
node
)
master
:=
GetMasterAddress
(
c
)
master
:=
GetMasterAddress
(
c
)
By
(
fmt
.
Sprintf
(
"block network traffic from node %s to the master"
,
node
.
Name
))
By
(
fmt
.
Sprintf
(
"block network traffic from node %s to the master"
,
node
.
Name
))
defer
func
()
{
defer
func
()
{
...
@@ -946,16 +944,14 @@ func TestUnderTemporaryNetworkFailure(c clientset.Interface, ns string, node *v1
...
@@ -946,16 +944,14 @@ func TestUnderTemporaryNetworkFailure(c clientset.Interface, ns string, node *v1
// had been inserted. (yes, we could look at the error code and ssh error
// had been inserted. (yes, we could look at the error code and ssh error
// separately, but I prefer to stay on the safe side).
// separately, but I prefer to stay on the safe side).
By
(
fmt
.
Sprintf
(
"Unblock network traffic from node %s to the master"
,
node
.
Name
))
By
(
fmt
.
Sprintf
(
"Unblock network traffic from node %s to the master"
,
node
.
Name
))
UnblockNetwork
(
externalIP
,
master
)
UnblockNetwork
(
host
,
master
)
UnblockNetwork
(
internalIP
,
master
)
}()
}()
Logf
(
"Waiting %v to ensure node %s is ready before beginning test..."
,
resizeNodeReadyTimeout
,
node
.
Name
)
Logf
(
"Waiting %v to ensure node %s is ready before beginning test..."
,
resizeNodeReadyTimeout
,
node
.
Name
)
if
!
WaitForNodeToBe
(
c
,
node
.
Name
,
v1
.
NodeReady
,
true
,
resizeNodeReadyTimeout
)
{
if
!
WaitForNodeToBe
(
c
,
node
.
Name
,
v1
.
NodeReady
,
true
,
resizeNodeReadyTimeout
)
{
Failf
(
"Node %s did not become ready within %v"
,
node
.
Name
,
resizeNodeReadyTimeout
)
Failf
(
"Node %s did not become ready within %v"
,
node
.
Name
,
resizeNodeReadyTimeout
)
}
}
BlockNetwork
(
externalIP
,
master
)
BlockNetwork
(
host
,
master
)
BlockNetwork
(
internalIP
,
master
)
Logf
(
"Waiting %v for node %s to be not ready after simulated network failure"
,
resizeNodeNotReadyTimeout
,
node
.
Name
)
Logf
(
"Waiting %v for node %s to be not ready after simulated network failure"
,
resizeNodeNotReadyTimeout
,
node
.
Name
)
if
!
WaitForNodeToBe
(
c
,
node
.
Name
,
v1
.
NodeReady
,
false
,
resizeNodeNotReadyTimeout
)
{
if
!
WaitForNodeToBe
(
c
,
node
.
Name
,
v1
.
NodeReady
,
false
,
resizeNodeNotReadyTimeout
)
{
...
...
test/e2e/framework/util.go
View file @
c72fc500
...
@@ -4925,23 +4925,6 @@ func GetNodeExternalIP(node *v1.Node) string {
...
@@ -4925,23 +4925,6 @@ func GetNodeExternalIP(node *v1.Node) string {
return
host
return
host
}
}
// GetNodeInternalIP returns node internal IP concatenated with port 22 for ssh
// e.g. 1.2.3.4:22
func
GetNodeInternalIP
(
node
*
v1
.
Node
)
string
{
Logf
(
"Getting internal IP address for %s"
,
node
.
Name
)
host
:=
""
for
_
,
a
:=
range
node
.
Status
.
Addresses
{
if
a
.
Type
==
v1
.
NodeInternalIP
{
host
=
net
.
JoinHostPort
(
a
.
Address
,
sshPort
)
break
}
}
if
host
==
""
{
Failf
(
"Couldn't get the internal IP of host %s with addresses %v"
,
node
.
Name
,
node
.
Status
.
Addresses
)
}
return
host
}
// SimpleGET executes a get on the given url, returns error if non-200 returned.
// SimpleGET executes a get on the given url, returns error if non-200 returned.
func
SimpleGET
(
c
*
http
.
Client
,
url
,
host
string
)
(
string
,
error
)
{
func
SimpleGET
(
c
*
http
.
Client
,
url
,
host
string
)
(
string
,
error
)
{
req
,
err
:=
http
.
NewRequest
(
"GET"
,
url
,
nil
)
req
,
err
:=
http
.
NewRequest
(
"GET"
,
url
,
nil
)
...
...
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