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
b7d76023
Commit
b7d76023
authored
Oct 04, 2016
by
Marek Grabowski
Committed by
GitHub
Oct 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "move pod networking tests common"
parent
ee77d4e6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
86 deletions
+2
-86
networking.go
test/e2e/common/networking.go
+0
-62
util.go
test/e2e/common/util.go
+0
-1
networking.go
test/e2e/networking.go
+0
-0
networking_utils.go
test/e2e/networking_utils.go
+0
-0
remote.go
test/e2e_node/remote/remote.go
+2
-23
No files found.
test/e2e/common/networking.go
deleted
100644 → 0
View file @
ee77d4e6
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
common
import
(
.
"github.com/onsi/ginkgo"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/test/e2e/framework"
networking_util
"k8s.io/kubernetes/test/utils"
)
var
_
=
framework
.
KubeDescribe
(
"Networking"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"pod-network-test"
)
framework
.
KubeDescribe
(
"Granular Checks: Pods"
,
func
()
{
// Try to hit all endpoints through a test container, retry 5 times,
// expect exactly one unique hostname. Each of these endpoints reports
// its own hostname.
It
(
"should function for intra-pod communication: http [Conformance]"
,
func
()
{
config
:=
networking_util
.
NewCoreNetworkingTestConfig
(
f
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromTestContainer
(
"http"
,
endpointPod
.
Status
.
PodIP
,
networking_util
.
EndpointHttpPort
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
})
It
(
"should function for intra-pod communication: udp [Conformance]"
,
func
()
{
config
:=
networking_util
.
NewCoreNetworkingTestConfig
(
f
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromTestContainer
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
networking_util
.
EndpointUdpPort
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
})
It
(
"should function for node-pod communication: http [Conformance]"
,
func
()
{
config
:=
networking_util
.
NewCoreNetworkingTestConfig
(
f
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromNode
(
"http"
,
endpointPod
.
Status
.
PodIP
,
networking_util
.
EndpointHttpPort
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
})
It
(
"should function for node-pod communication: udp [Conformance]"
,
func
()
{
config
:=
networking_util
.
NewCoreNetworkingTestConfig
(
f
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromNode
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
networking_util
.
EndpointUdpPort
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
})
})
})
test/e2e/common/util.go
View file @
b7d76023
...
...
@@ -40,7 +40,6 @@ var CommonImageWhiteList = sets.NewString(
"gcr.io/google_containers/mounttest:0.7"
,
"gcr.io/google_containers/mounttest-user:0.3"
,
"gcr.io/google_containers/netexec:1.4"
,
"gcr.io/google_containers/netexec:1.5"
,
"gcr.io/google_containers/nginx-slim:0.7"
,
"gcr.io/google_containers/serve_hostname:v1.4"
,
"gcr.io/google_containers/test-webserver:e2e"
,
...
...
test/e2e/networking.go
View file @
b7d76023
This diff is collapsed.
Click to expand it.
test/
utils
/networking_utils.go
→
test/
e2e
/networking_utils.go
View file @
b7d76023
This diff is collapsed.
Click to expand it.
test/e2e_node/remote/remote.go
View file @
b7d76023
...
...
@@ -165,27 +165,6 @@ func RunRemote(archive string, host string, cleanup bool, junitFilePrefix string
return
""
,
false
,
err
}
// Configure iptables firewall rules
// TODO: consider calling bootstrap script to configure host based on OS
cmd
:=
getSshCommand
(
"&&"
,
`iptables -L INPUT | grep "Chain INPUT (policy DROP)"`
,
"(iptables -C INPUT -w -p TCP -j ACCEPT || iptables -A INPUT -w -p TCP -j ACCEPT)"
,
"(iptables -C INPUT -w -p UDP -j ACCEPT || iptables -A INPUT -w -p UDP -j ACCEPT)"
,
"(iptables -C INPUT -w -p ICMP -j ACCEPT || iptables -A INPUT -w -p ICMP -j ACCEPT)"
)
output
,
err
:=
RunSshCommand
(
"ssh"
,
GetHostnameOrIp
(
host
),
"--"
,
"sudo"
,
"sh"
,
"-c"
,
cmd
)
if
err
!=
nil
{
glog
.
Errorf
(
"Failed to configured firewall: %v output: %v"
,
err
,
output
)
}
cmd
=
getSshCommand
(
"&&"
,
`iptables -L FORWARD | grep "Chain FORWARD (policy DROP)" > /dev/null`
,
"(iptables -C FORWARD -w -p TCP -j ACCEPT || iptables -A FORWARD -w -p TCP -j ACCEPT)"
,
"(iptables -C FORWARD -w -p UDP -j ACCEPT || iptables -A FORWARD -w -p UDP -j ACCEPT)"
,
"(iptables -C FORWARD -w -p ICMP -j ACCEPT || iptables -A FORWARD -w -p ICMP -j ACCEPT)"
)
output
,
err
=
RunSshCommand
(
"ssh"
,
GetHostnameOrIp
(
host
),
"--"
,
"sudo"
,
"sh"
,
"-c"
,
cmd
)
if
err
!=
nil
{
glog
.
Errorf
(
"Failed to configured firewall: %v output: %v"
,
err
,
output
)
}
// Copy the archive to the staging directory
_
,
err
=
RunSshCommand
(
"scp"
,
archive
,
fmt
.
Sprintf
(
"%s:%s/"
,
GetHostnameOrIp
(
host
),
tmp
))
if
err
!=
nil
{
...
...
@@ -194,7 +173,7 @@ func RunRemote(archive string, host string, cleanup bool, junitFilePrefix string
}
// Kill any running node processes
cmd
=
getSshCommand
(
" ; "
,
cmd
:
=
getSshCommand
(
" ; "
,
"sudo pkill kubelet"
,
"sudo pkill kube-apiserver"
,
"sudo pkill etcd"
,
...
...
@@ -208,7 +187,7 @@ func RunRemote(archive string, host string, cleanup bool, junitFilePrefix string
// Extract the archive
cmd
=
getSshCommand
(
" && "
,
fmt
.
Sprintf
(
"cd %s"
,
tmp
),
fmt
.
Sprintf
(
"tar -xzvf ./%s"
,
archiveName
))
glog
.
Infof
(
"Extracting tar on %s"
,
host
)
output
,
err
=
RunSshCommand
(
"ssh"
,
GetHostnameOrIp
(
host
),
"--"
,
"sh"
,
"-c"
,
cmd
)
output
,
err
:
=
RunSshCommand
(
"ssh"
,
GetHostnameOrIp
(
host
),
"--"
,
"sh"
,
"-c"
,
cmd
)
if
err
!=
nil
{
// Exit failure with the error
return
""
,
false
,
err
...
...
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