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
62337e7c
Commit
62337e7c
authored
Jul 05, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable kubenet for local node e2e test.
parent
d07328dc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
13 deletions
+26
-13
e2e-node-test.sh
hack/e2e-node-test.sh
+1
-1
known-flags.txt
hack/verify-flags/known-flags.txt
+1
-0
e2e_remote.go
test/e2e_node/e2e_remote.go
+13
-11
e2e_service.go
test/e2e_node/e2e_service.go
+10
-1
util.go
test/e2e_node/util.go
+1
-0
No files found.
hack/e2e-node-test.sh
View file @
62337e7c
...
@@ -129,6 +129,6 @@ else
...
@@ -129,6 +129,6 @@ else
# Test using the host the script was run on
# Test using the host the script was run on
# Provided for backwards compatibility
# Provided for backwards compatibility
"
${
ginkgo
}
"
--focus
=
$focus
--skip
=
$skip
"
${
KUBE_ROOT
}
/test/e2e_node/"
--report-dir
=
${
report
}
\
"
${
ginkgo
}
"
--focus
=
$focus
--skip
=
$skip
"
${
KUBE_ROOT
}
/test/e2e_node/"
--report-dir
=
${
report
}
\
--
--alsologtostderr
--v
2
--node-name
$(
hostname
)
--build-services
=
true
--start-services
=
true
--stop-services
=
true
--
--alsologtostderr
--v
2
--node-name
$(
hostname
)
--
disable-kubenet
=
true
--
build-services
=
true
--start-services
=
true
--stop-services
=
true
exit
$?
exit
$?
fi
fi
hack/verify-flags/known-flags.txt
View file @
62337e7c
...
@@ -99,6 +99,7 @@ deployment-label-key
...
@@ -99,6 +99,7 @@ deployment-label-key
deserialization-cache-size
deserialization-cache-size
dest-file
dest-file
disable-filter
disable-filter
disable-kubenet
dns-port
dns-port
dns-provider
dns-provider
dns-provider-config
dns-provider-config
...
...
test/e2e_node/e2e_remote.go
View file @
62337e7c
...
@@ -41,11 +41,12 @@ var ginkgoFlags = flag.String("ginkgo-flags", "", "Passed to ginkgo to specify a
...
@@ -41,11 +41,12 @@ var ginkgoFlags = flag.String("ginkgo-flags", "", "Passed to ginkgo to specify a
var
sshOptionsMap
map
[
string
]
string
var
sshOptionsMap
map
[
string
]
string
const
(
const
(
archiveName
=
"e2e_node_test.tar.gz"
archiveName
=
"e2e_node_test.tar.gz"
CNI_RELEASE
=
"c864f0e1ea73719b8f4582402b0847064f9883b0"
CNIRelease
=
"c864f0e1ea73719b8f4582402b0847064f9883b0"
CNIDirectory
=
"cni"
)
)
var
CNI
_URL
=
fmt
.
Sprintf
(
"https://storage.googleapis.com/kubernetes-release/network-plugins/cni-%s.tar.gz"
,
CNI_RELEASE
)
var
CNI
URL
=
fmt
.
Sprintf
(
"https://storage.googleapis.com/kubernetes-release/network-plugins/cni-%s.tar.gz"
,
CNIRelease
)
var
hostnameIpOverrides
=
struct
{
var
hostnameIpOverrides
=
struct
{
sync
.
RWMutex
sync
.
RWMutex
...
@@ -157,14 +158,6 @@ func RunRemote(archive string, host string, cleanup bool, junitFileNumber int, s
...
@@ -157,14 +158,6 @@ func RunRemote(archive string, host string, cleanup bool, junitFileNumber int, s
}
}
}
}
// Install the cni plugin. Note that /opt/cni does not get cleaned up after
// the test completes.
if
_
,
err
:=
RunSshCommand
(
"ssh"
,
GetHostnameOrIp
(
host
),
"--"
,
"sh"
,
"-c"
,
getSshCommand
(
" ; "
,
"sudo mkdir -p /opt/cni"
,
fmt
.
Sprintf
(
"sudo wget -O - %s | sudo tar -xz -C /opt/cni"
,
CNI_URL
)));
err
!=
nil
{
// Exit failure with the error
return
""
,
false
,
err
}
// Create the temp staging directory
// Create the temp staging directory
glog
.
Infof
(
"Staging test binaries on %s"
,
host
)
glog
.
Infof
(
"Staging test binaries on %s"
,
host
)
tmp
:=
fmt
.
Sprintf
(
"/tmp/gcloud-e2e-%d"
,
rand
.
Int31
())
tmp
:=
fmt
.
Sprintf
(
"/tmp/gcloud-e2e-%d"
,
rand
.
Int31
())
...
@@ -182,6 +175,15 @@ func RunRemote(archive string, host string, cleanup bool, junitFileNumber int, s
...
@@ -182,6 +175,15 @@ func RunRemote(archive string, host string, cleanup bool, junitFileNumber int, s
}()
}()
}
}
// Install the cni plugin.
cniPath
:=
filepath
.
Join
(
tmp
,
CNIDirectory
)
if
_
,
err
:=
RunSshCommand
(
"ssh"
,
GetHostnameOrIp
(
host
),
"--"
,
"sh"
,
"-c"
,
getSshCommand
(
" ; "
,
fmt
.
Sprintf
(
"sudo mkdir -p %s"
,
cniPath
),
fmt
.
Sprintf
(
"sudo wget -O - %s | sudo tar -xz -C %s"
,
CNIURL
,
cniPath
)));
err
!=
nil
{
// Exit failure with the error
return
""
,
false
,
err
}
// Copy the archive to the staging directory
// Copy the archive to the staging directory
_
,
err
=
RunSshCommand
(
"scp"
,
archive
,
fmt
.
Sprintf
(
"%s:%s/"
,
GetHostnameOrIp
(
host
),
tmp
))
_
,
err
=
RunSshCommand
(
"scp"
,
archive
,
fmt
.
Sprintf
(
"%s:%s/"
,
GetHostnameOrIp
(
host
),
tmp
))
if
err
!=
nil
{
if
err
!=
nil
{
...
...
test/e2e_node/e2e_service.go
View file @
62337e7c
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
"os"
"os"
"os/exec"
"os/exec"
"path"
"path"
"path/filepath"
"reflect"
"reflect"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -233,9 +234,17 @@ func (es *e2eService) startKubeletServer() (*killCmd, error) {
...
@@ -233,9 +234,17 @@ func (es *e2eService) startKubeletServer() (*killCmd, error) {
"--config"
,
es
.
kubeletStaticPodDir
,
"--config"
,
es
.
kubeletStaticPodDir
,
"--file-check-frequency"
,
"10s"
,
// Check file frequently so tests won't wait too long
"--file-check-frequency"
,
"10s"
,
// Check file frequently so tests won't wait too long
"--v"
,
LOG_VERBOSITY_LEVEL
,
"--logtostderr"
,
"--v"
,
LOG_VERBOSITY_LEVEL
,
"--logtostderr"
,
"--network-plugin=kubenet"
,
"--pod-cidr=10.180.0.0/24"
,
// Assign a fixed CIDR to the node because there is no node controller.
"--pod-cidr=10.180.0.0/24"
,
// Assign a fixed CIDR to the node because there is no node controller.
)
)
if
!*
disableKubenet
{
cwd
,
err
:=
os
.
Getwd
()
if
err
!=
nil
{
return
nil
,
err
}
cmdArgs
=
append
(
cmdArgs
,
"--network-plugin=kubenet"
,
"--network-plugin-dir"
,
filepath
.
Join
(
cwd
,
CNIDirectory
,
"bin"
))
// Enable kubenet
}
cmd
:=
exec
.
Command
(
"sudo"
,
cmdArgs
...
)
cmd
:=
exec
.
Command
(
"sudo"
,
cmdArgs
...
)
hcc
:=
newHealthCheckCommand
(
hcc
:=
newHealthCheckCommand
(
"http://127.0.0.1:10255/healthz"
,
"http://127.0.0.1:10255/healthz"
,
...
...
test/e2e_node/util.go
View file @
62337e7c
...
@@ -26,6 +26,7 @@ import (
...
@@ -26,6 +26,7 @@ import (
var
kubeletAddress
=
flag
.
String
(
"kubelet-address"
,
"http://127.0.0.1:10255"
,
"Host and port of the kubelet"
)
var
kubeletAddress
=
flag
.
String
(
"kubelet-address"
,
"http://127.0.0.1:10255"
,
"Host and port of the kubelet"
)
var
apiServerAddress
=
flag
.
String
(
"api-server-address"
,
"http://127.0.0.1:8080"
,
"Host and port of the api server"
)
var
apiServerAddress
=
flag
.
String
(
"api-server-address"
,
"http://127.0.0.1:8080"
,
"Host and port of the api server"
)
var
disableKubenet
=
flag
.
Bool
(
"disable-kubenet"
,
false
,
"If true, start kubelet without kubenet"
)
var
buildServices
=
flag
.
Bool
(
"build-services"
,
true
,
"If true, build local executables"
)
var
buildServices
=
flag
.
Bool
(
"build-services"
,
true
,
"If true, build local executables"
)
var
startServices
=
flag
.
Bool
(
"start-services"
,
true
,
"If true, start local node services"
)
var
startServices
=
flag
.
Bool
(
"start-services"
,
true
,
"If true, start local node services"
)
var
stopServices
=
flag
.
Bool
(
"stop-services"
,
true
,
"If true, stop local node services after running tests"
)
var
stopServices
=
flag
.
Bool
(
"stop-services"
,
true
,
"If true, stop local node services after running tests"
)
...
...
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