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
396254c1
Commit
396254c1
authored
Jul 25, 2016
by
k8s-merge-robot
Committed by
GitHub
Jul 25, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #29486 from vishh/gci-node-e2e
Automatic merge from submit-queue Make it possible to run node e2e with GCI.
parents
e7db6687
d31608fc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
9 deletions
+27
-9
Makefile
Makefile
+1
-0
e2e-node-tests.md
docs/devel/e2e-node-tests.md
+1
-0
test-e2e-node.sh
hack/make-rules/test-e2e-node.sh
+3
-2
e2e_node_suite_test.go
test/e2e_node/e2e_node_suite_test.go
+3
-1
e2e_service.go
test/e2e_node/e2e_service.go
+12
-1
gci-init.yaml
test/e2e_node/jenkins/gci-init.yaml
+3
-3
run_e2e.go
test/e2e_node/runner/run_e2e.go
+4
-2
No files found.
Makefile
View file @
396254c1
...
...
@@ -157,6 +157,7 @@ test-e2e: ginkgo generated_files
# IMAGES. Defaults to "kubernetes-node-e2e-images".
# INSTANCE_PREFIX: For REMOTE=true only. Instances created from images will
# have the name "${INSTANCE_PREFIX}-${IMAGE_NAME}". Defaults to "test".
# INSTANCE_METADATA: For REMOTE=true and running on GCE only.
#
# Example:
# make test-e2e-node FOCUS=Kubelet SKIP=container
...
...
docs/devel/e2e-node-tests.md
View file @
396254c1
...
...
@@ -51,6 +51,7 @@ Why run tests *Locally*? Much faster than running tests Remotely.
Prerequisites:
-
[
Install etcd
](
https://github.com/coreos/etcd/releases
)
on your PATH
-
Verify etcd is installed correctly by running
`which etcd`
-
Or make etcd binary available and executable at
`/tmp/etcd`
-
[
Install ginkgo
](
https://github.com/onsi/ginkgo
)
on your PATH
-
Verify ginkgo is installed correctly by running
`which ginkgo`
...
...
hack/make-rules/test-e2e-node.sh
View file @
396254c1
...
...
@@ -34,6 +34,7 @@ delete_instances=${DELETE_INSTANCES:-"false"}
run_until_failure
=
${
RUN_UNTIL_FAILURE
:-
"false"
}
list_images
=
${
LIST_IMAGES
:-
"false"
}
test_args
=
${
TEST_ARGS
:-
""
}
metadata
=
${
INSTANCE_METADATA
:-
""
}
if
[[
$list_images
==
"true"
]]
;
then
gcloud compute images list
--project
=
"
${
image_project
}
"
|
grep
"e2e-node"
...
...
@@ -111,14 +112,14 @@ if [ $remote = true ] ; then
echo
"Images:
$images
"
echo
"Hosts:
$hosts
"
echo
"Ginkgo Flags:
$ginkgoflags
"
echo
"Instance Metadata:
$metadata
"
# Invoke the runner
go run
test
/e2e_node/runner/run_e2e.go
--logtostderr
--vmodule
=
*
=
2
--ssh-env
=
"gce"
\
--zone
=
"
$zone
"
--project
=
"
$project
"
\
--hosts
=
"
$hosts
"
--images
=
"
$images
"
--cleanup
=
"
$cleanup
"
\
--results-dir
=
"
$artifacts
"
--ginkgo-flags
=
"
$ginkgoflags
"
\
--image-project
=
"
$image_project
"
--instance-name-prefix
=
"
$instance_prefix
"
--setup-node
=
"true"
\
--delete-instances
=
"
$delete_instances
"
--test_args
=
"
$test_args
"
--delete-instances
=
"
$delete_instances
"
--test_args
=
"
$test_args
"
--instance-metadata
=
"
$metadata
"
exit
$?
else
...
...
test/e2e_node/e2e_node_suite_test.go
View file @
396254c1
...
...
@@ -135,7 +135,9 @@ var _ = AfterSuite(func() {
func
maskLocksmithdOnCoreos
()
{
data
,
err
:=
ioutil
.
ReadFile
(
"/etc/os-release"
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Could not read /etc/os-release: %v"
,
err
)
// Not all distros contain this file.
glog
.
Infof
(
"Could not read /etc/os-release: %v"
,
err
)
return
}
if
bytes
.
Contains
(
data
,
[]
byte
(
"ID=coreos"
))
{
if
output
,
err
:=
exec
.
Command
(
"sudo"
,
"systemctl"
,
"mask"
,
"--now"
,
"locksmithd"
)
.
CombinedOutput
();
err
!=
nil
{
...
...
test/e2e_node/e2e_service.go
View file @
396254c1
...
...
@@ -57,6 +57,8 @@ type logFileData struct {
const
(
// This is consistent with the level used in a cluster e2e test.
LOG_VERBOSITY_LEVEL
=
"4"
// Etcd binary is expected to either be available via PATH, or at this location.
defaultEtcdPath
=
"/tmp/etcd"
)
func
newE2eService
(
nodeName
string
,
cgroupsPerQOS
bool
)
*
e2eService
{
...
...
@@ -179,7 +181,16 @@ func (es *e2eService) startEtcd() (*killCmd, error) {
return
nil
,
err
}
es
.
etcdDataDir
=
dataDir
cmd
:=
exec
.
Command
(
"etcd"
)
etcdPath
,
err
:=
exec
.
LookPath
(
"etcd"
)
if
err
!=
nil
{
glog
.
Infof
(
"etcd not found in PATH. Defaulting to %s..."
,
defaultEtcdPath
)
_
,
err
=
os
.
Stat
(
defaultEtcdPath
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"etcd binary not found"
)
}
etcdPath
=
defaultEtcdPath
}
cmd
:=
exec
.
Command
(
etcdPath
)
// Execute etcd in the data directory instead of using --data-dir because the flag sometimes requires additional
// configuration (e.g. --name in version 0.4.9)
cmd
.
Dir
=
es
.
etcdDataDir
...
...
test/e2e_node/jenkins/gci-init.yaml
View file @
396254c1
#cloud-config
runcmd
:
-
mount /tmp /tmp -o remount,exec,suid
-
ETCD_VERSION=v2.2.5
-
curl -L https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz -o /tmp/etcd.tar.gz
-
tar xzvf /tmp/etcd.tar.gz -C /tmp
-
sudo mv /tmp/etcd-${ETCD_VERSION}-linux-amd64/etcd* /usr/local/bin/
-
sudo chown root:root /usr/local/bin/etcd*
-
rm -r /tmp/etcd*
-
cp /tmp/etcd-${ETCD_VERSION}-linux-amd64/etcd* /tmp/
-
rm -rf /tmp/etcd-${ETCD_VERSION}-linux-amd64/
test/e2e_node/runner/run_e2e.go
View file @
396254c1
...
...
@@ -310,7 +310,9 @@ func createInstance(image, imageProject string) (string, error) {
},
}
if
*
instanceMetadata
!=
""
{
glog
.
V
(
2
)
.
Infof
(
"parsing instance metadata: %q"
,
*
instanceMetadata
)
raw
:=
parseInstanceMetadata
(
*
instanceMetadata
)
glog
.
V
(
3
)
.
Infof
(
"parsed instance metadata: %v"
,
raw
)
i
.
Metadata
=
&
compute
.
Metadata
{}
metadata
:=
[]
*
compute
.
MetadataItems
{}
for
k
,
v
:=
range
raw
{
...
...
@@ -422,12 +424,12 @@ func parseInstanceMetadata(str string) map[string]string {
}
kp
:=
strings
.
Split
(
s
,
"<"
)
if
len
(
kp
)
!=
2
{
glog
.
Error
f
(
"Invalid instance metadata: %q"
,
s
)
glog
.
Fatal
f
(
"Invalid instance metadata: %q"
,
s
)
continue
}
v
,
err
:=
ioutil
.
ReadFile
(
kp
[
1
])
if
err
!=
nil
{
glog
.
Error
f
(
"Failed to read metadata file %q: %v"
,
kp
[
1
],
err
)
glog
.
Fatal
f
(
"Failed to read metadata file %q: %v"
,
kp
[
1
],
err
)
continue
}
metadata
[
kp
[
0
]]
=
string
(
v
)
...
...
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