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
c7499750
Commit
c7499750
authored
May 31, 2016
by
pwittrock
Committed by
Phillip Wittrock
Jun 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Node e2e use vendored testing packages.
parent
9dc06e85
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
53 deletions
+32
-53
e2e-node-tests.md
docs/devel/e2e-node-tests.md
+27
-24
e2e_remote.go
test/e2e_node/e2e_remote.go
+5
-18
copy-e2e-image.sh
test/e2e_node/jenkins/copy-e2e-image.sh
+0
-0
e2e-node-jenkins.sh
test/e2e_node/jenkins/e2e-node-jenkins.sh
+0
-6
jenkins-ci.properties
test/e2e_node/jenkins/jenkins-ci.properties
+0
-1
jenkins-pull.properties
test/e2e_node/jenkins/jenkins-pull.properties
+0
-2
template.properties
test/e2e_node/jenkins/template.properties
+0
-2
No files found.
docs/devel/e2e-node-tests.md
View file @
c7499750
...
@@ -63,30 +63,40 @@ and remote passwordless sudo access over ssh)
...
@@ -63,30 +63,40 @@ and remote passwordless sudo access over ssh)
*
using
[
run_e2e.go
](
../../test/e2e_node/runner/run_e2e.go
)
to build a tar.gz
*
using
[
run_e2e.go
](
../../test/e2e_node/runner/run_e2e.go
)
to build a tar.gz
and executing on host (requires host access w/ remote sudo)
and executing on host (requires host access w/ remote sudo)
###
Configuring a new remote host
for testing
###
Option 1: Configuring a new remote host from scratch
for testing
The host must contain a environment capable of supporting a mini-kubernetes
The host must contain an environment capable of running a minimal kubernetes cluster
cluster. Includes:
consisting of etcd, the kube-apiserver, and kubelet. The steps required to step a host vary between distributions
(coreos, rhel, ubuntu, etc), but may include:
*
install etcd
*
install etcd
*
install docker
*
install docker
*
add user running tests to docker group
*
install lxc and update grub commandline
*
install lxc and update grub commandline
*
enable tty-less sudo access
*
enable tty-less sudo access
See
[
setup_host.sh
](
../../test/e2e_node/environment/setup_host.sh
)
These steps should be captured in
[
setup_host.sh
](
../../test/e2e_node/environment/setup_host.sh
)
###
Running the tests
###
Option 2: Copying an existing host image from another project
1.
If running against a host on gce
If there is an existing image in another project you would like to use, you can use the script
[
copy-e2e-image.sh
](
../../test/e2e_node/jenkins/copy-e2e-image.sh
)
to copy an image
from one GCE project to another.
*
Copy
[
template.properties
](
../../test/e2e_node/jenkins/template.properties
)
```
sh
copy-e2e-image.sh <image-to-be-copied-name> <from-gce-project> <to-gce-project>
```
* Fill in `GCE_HOSTS`
### Running the tests
* Set `INSTALL_GODEP=true` to install `godep`, `gomega`, `ginkgo`
*
Make sure host names are resolvable to ssh
`ssh <host>`
.
1.
If running tests against a running host on gce
* If needed, you can run `gcloud compute config-ssh` to add gce hostnames to
*
Make sure host names are resolvable to ssh by running
`gcloud compute config-ssh`
to
your .ssh/config so they are resolvable by ssh.
update ~/.ssh/config with the GCE hosts. After running this command, check the hostnames
in the ~/.ssh/config file and verify you have the correct access by running
`ssh <host>`
.
*
Copy
[
template.properties
](
../../test/e2e_node/jenkins/template.properties
)
* Fill in `GCE_HOSTS` with the name of the host
*
Run
`test/e2e_node/jenkins/e2e-node-jenkins.sh <path to properties file>`
*
Run
`test/e2e_node/jenkins/e2e-node-jenkins.sh <path to properties file>`
*
**Must be run from kubernetes root**
*
**Must be run from kubernetes root**
...
@@ -103,8 +113,6 @@ tests with `--ssh-options`
...
@@ -103,8 +113,6 @@ tests with `--ssh-options`
separated hosts>`
separated hosts>`
* **Must be run from kubernetes root**
* **Must be run from kubernetes root**
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`,
`github.com/onsi/ginkgo/ginkgo`
3.
Alternatively, manually build and copy
`e2e_node_test.tar.gz`
to a remote
3.
Alternatively, manually build and copy
`e2e_node_test.tar.gz`
to a remote
host
host
...
@@ -112,9 +120,6 @@ host
...
@@ -112,9 +120,6 @@ host
*
Build the tar.gz
`go run test/e2e_node/runner/run_e2e.go --logtostderr
*
Build the tar.gz
`go run test/e2e_node/runner/run_e2e.go --logtostderr
--build-only`
--build-only`
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`,
`github.com/onsi/ginkgo/ginkgo`
*
Copy
`e2e_node_test.tar.gz`
to the remote host
*
Copy
`e2e_node_test.tar.gz`
to the remote host
*
Extract the archive on the remote host
`tar -xzvf e2e_node_test.tar.gz`
*
Extract the archive on the remote host
`tar -xzvf e2e_node_test.tar.gz`
...
@@ -127,13 +132,15 @@ kube-apiserver binaries.
...
@@ -127,13 +132,15 @@ kube-apiserver binaries.
## Running tests against a gce image
## Running tests against a gce image
*
Build a gce image from a prepared gce host
*
Option 1:
Build a gce image from a prepared gce host
*
Create the host from a base image and configure it (see above)
*
Create the host from a base image and configure it (see above)
*
Run tests against this remote host to ensure that it is setup correctly
*
Run tests against this remote host to ensure that it is setup correctly
before doing anything else
before doing anything else
*
Create a gce
*snapshot*
of the instance
*
Create a gce
*snapshot*
of the instance
*
Create a gce
*disk*
from the snapshot
*
Create a gce
*disk*
from the snapshot
*
Create a gce
*image*
from the disk
*
Create a gce
*image*
from the disk
*
Option 2: Copy a prepared image from another project
*
Instructions above
*
Test that the necessary gcloud credentials are setup for the project
*
Test that the necessary gcloud credentials are setup for the project
*
`gcloud compute --project <project> --zone <zone> images list`
*
`gcloud compute --project <project> --zone <zone> images list`
*
Verify that your image appears in the list
*
Verify that your image appears in the list
...
@@ -146,9 +153,7 @@ before doing anything else
...
@@ -146,9 +153,7 @@ before doing anything else
Node e2e tests are run against a static list of host environments continuously
Node e2e tests are run against a static list of host environments continuously
or when manually triggered on a github.com pull requests using the trigger
or when manually triggered on a github.com pull requests using the trigger
phrase
`@k8s-bot test node e2e experimental`
-
*
results not yet publish, pending
phrase
`@k8s-bot test node e2e`
evaluation of test stability.
*
.
### CI Host environments
### CI Host environments
...
@@ -159,14 +164,12 @@ TBD
...
@@ -159,14 +164,12 @@ TBD
| linux distro | distro version | docker version | etcd version | cloud provider |
| linux distro | distro version | docker version | etcd version | cloud provider |
|-----------------|----------------|----------------|--------------|----------------|
|-----------------|----------------|----------------|--------------|----------------|
| containervm | | 1.8 | | gce |
| containervm | | 1.8 | | gce |
| rhel | 7 | 1.10 | | gce |
| centos | 7 | 1.10 | | gce |
| coreos | stable | 1.8 | | gce |
| coreos | stable | 1.8 | | gce |
| debian | jessie | 1.10 | | gce |
| debian | jessie | 1.10 | | gce |
| ubuntu | trusty | 1.8 | | gce |
| ubuntu | trusty | 1.8 | | gce |
| ubuntu | trusty | 1.9 | | gce |
| ubuntu | trusty | 1.9 | | gce |
| ubuntu | trusty | 1.10 | | gce |
| ubuntu | trusty | 1.10 | | gce |
| ubuntu | wily | 1.10 | | gce |
...
...
test/e2e_node/e2e_remote.go
View file @
c7499750
...
@@ -57,30 +57,17 @@ func CreateTestArchive() string {
...
@@ -57,30 +57,17 @@ func CreateTestArchive() string {
// Build the executables
// Build the executables
buildGo
()
buildGo
()
// Build the e2e tests into an executable
// Make sure we can find the newly built binaries
glog
.
Infof
(
"Building ginkgo k8s test binaries..."
)
buildOutputDir
,
err
:=
getK8sBuildOutputDir
()
testDir
,
err
:=
getK8sNodeTestDir
()
if
err
!=
nil
{
glog
.
Fatalf
(
"Failed to locate test/e2e_node directory %v."
,
err
)
}
cmd
:=
exec
.
Command
(
"ginkgo"
,
"build"
,
testDir
)
cmd
.
Stdout
=
os
.
Stdout
cmd
.
Stderr
=
os
.
Stderr
err
=
cmd
.
Run
()
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Fatalf
(
"Failed to
build e2e tests under %s %v
\n
"
,
testDir
,
err
)
glog
.
Fatalf
(
"Failed to
locate kubernetes build output directory %v"
,
err
)
}
}
ginkgoTest
:=
filepath
.
Join
(
testDir
,
"e2e_node.test"
)
ginkgoTest
:=
filepath
.
Join
(
buildOutputDir
,
"e2e_node.test"
)
if
_
,
err
:=
os
.
Stat
(
ginkgoTest
);
err
!=
nil
{
if
_
,
err
:=
os
.
Stat
(
ginkgoTest
);
err
!=
nil
{
glog
.
Fatalf
(
"Failed to locate test binary %s"
,
ginkgoTest
)
glog
.
Fatalf
(
"Failed to locate test binary %s"
,
ginkgoTest
)
}
}
defer
os
.
Remove
(
ginkgoTest
)
// Make sure we can find the newly built binaries
buildOutputDir
,
err
:=
getK8sBuildOutputDir
()
if
err
!=
nil
{
glog
.
Fatalf
(
"Failed to locate kubernetes build output directory %v"
,
err
)
}
kubelet
:=
filepath
.
Join
(
buildOutputDir
,
"kubelet"
)
kubelet
:=
filepath
.
Join
(
buildOutputDir
,
"kubelet"
)
if
_
,
err
:=
os
.
Stat
(
kubelet
);
err
!=
nil
{
if
_
,
err
:=
os
.
Stat
(
kubelet
);
err
!=
nil
{
glog
.
Fatalf
(
"Failed to locate binary %s"
,
kubelet
)
glog
.
Fatalf
(
"Failed to locate binary %s"
,
kubelet
)
...
...
test/e2e_node/jenkins/copy-e2e-image.sh
100644 → 100755
View file @
c7499750
File mode changed from 100644 to 100755
test/e2e_node/jenkins/e2e-node-jenkins.sh
View file @
c7499750
...
@@ -28,12 +28,6 @@ set -x
...
@@ -28,12 +28,6 @@ set -x
.
$1
.
$1
if
[
"
$INSTALL_GODEP
"
=
true
]
;
then
go get
-u
github.com/tools/godep
go get
-u
github.com/onsi/ginkgo/ginkgo
go get
-u
github.com/onsi/gomega
fi
go build
test
/e2e_node/environment/conformance.go
go build
test
/e2e_node/environment/conformance.go
ARTIFACTS
=
${
WORKSPACE
}
/_artifacts
ARTIFACTS
=
${
WORKSPACE
}
/_artifacts
mkdir
-p
${
ARTIFACTS
}
mkdir
-p
${
ARTIFACTS
}
...
...
test/e2e_node/jenkins/jenkins-ci.properties
View file @
c7499750
...
@@ -7,7 +7,6 @@ GCE_IMAGES=e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-
...
@@ -7,7 +7,6 @@ GCE_IMAGES=e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-
GCE_ZONE
=
us-central1-f
GCE_ZONE
=
us-central1-f
GCE_PROJECT
=
kubernetes-jenkins
GCE_PROJECT
=
kubernetes-jenkins
GCE_IMAGE_PROJECT
=
kubernetes-jenkins
GCE_IMAGE_PROJECT
=
kubernetes-jenkins
INSTALL_GODEP
=
true
CLEANUP
=
true
CLEANUP
=
true
GINKGO_FLAGS
=
GINKGO_FLAGS
=
SETUP_NODE
=
false
SETUP_NODE
=
false
...
...
test/e2e_node/jenkins/jenkins-pull.properties
View file @
c7499750
...
@@ -7,7 +7,6 @@ GCE_IMAGES=e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-
...
@@ -7,7 +7,6 @@ GCE_IMAGES=e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-
GCE_ZONE
=
us-central1-f
GCE_ZONE
=
us-central1-f
GCE_PROJECT
=
kubernetes-jenkins-pull
GCE_PROJECT
=
kubernetes-jenkins-pull
GCE_IMAGE_PROJECT
=
kubernetes-jenkins-pull
GCE_IMAGE_PROJECT
=
kubernetes-jenkins-pull
INSTALL_GODEP
=
true
CLEANUP
=
true
CLEANUP
=
true
GINKGO_FLAGS
=
GINKGO_FLAGS
=
SETUP_NODE
=
false
SETUP_NODE
=
false
\ No newline at end of file
test/e2e_node/jenkins/template.properties
View file @
c7499750
...
@@ -11,8 +11,6 @@ GCE_PROJECT=
...
@@ -11,8 +11,6 @@ GCE_PROJECT=
# Gce project to use for GCE_IMAGES
# Gce project to use for GCE_IMAGES
# required when using GCE_IMAGES
# required when using GCE_IMAGES
GCE_IMAGE_PROJECT
=
GCE_IMAGE_PROJECT
=
# If true, assume a pristine GOPATH and install necessary godeps
INSTALL_GODEP
=
false
# If true, delete instances created from GCE_IMAGES and files copied to GCE_HOSTS
# If true, delete instances created from GCE_IMAGES and files copied to GCE_HOSTS
CLEANUP
=
true
CLEANUP
=
true
# If true, current user will be added to the docker group on test node
# If true, current user will be added to the docker group on test node
...
...
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