Reproduces issue #2836, i.e.: - during initialisation: ``` $ ps auxf [...] root 1380 0.4 1.6 879660 60732 ? Ssl Mar13 5:54 /usr/bin/docker daemon -H fd:// -H unix:/// root 1664 0.0 0.4 502116 18540 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li root 12615 0.0 0.1 200496 5424 ? Sl 14:38 0:00 \_ docker-containerd-shim c5637e5bbdcb root 12629 6.2 1.6 296400 62312 ? Ssl 14:38 0:00 | \_ /home/weave/weaver --port=6783 root 12910 0.0 0.0 1524 68 ? S 14:38 0:00 | \_ /bin/sh /home/weave/launch. root 13002 0.0 0.0 1772 1232 ? S 14:38 0:00 | \_ /bin/sh /home/weave/wea root 13027 0.0 0.0 1772 320 ? S 14:38 0:00 | \_ /bin/sh /home/weave root 13028 0.0 0.0 14656 2708 ? S 14:38 0:00 | \_ curl -o /tmp/we [...] ``` - after initialisation: ``` $ ps auxf [...] root 1380 0.4 1.6 879660 60732 ? Ssl Mar13 5:54 /usr/bin/docker daemon -H fd:// -H unix:/// root 1664 0.0 0.4 502116 18540 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li root 12615 0.0 0.1 200496 5424 ? Sl 14:38 0:00 \_ docker-containerd-shim c5637e5bbdcb root 12629 3.5 1.6 297460 63340 ? Ssl 14:38 0:00 | \_ /home/weave/weaver --port=6783 root 12910 0.0 0.0 0 0 ? Z 14:38 0:00 | \_ [launch.sh] <defunct> [...] ``` Sample output: ``` test #5 "run_on mct-0.us-central1-a.weave-net ps aux | grep -c '[d]efunct'" failed: expected "0" got "1" test #6 "run_on mct-1.us-central1-a.weave-net ps aux | grep -c '[d]efunct'" failed: expected "0" got "1" test #7 "run_on mct-2.us-central1-a.weave-net ps aux | grep -c '[d]efunct'" failed: expected "0" got "1" 3 of 8 tests failed in 62.012s. ```
This directory contains integration tests for weave.
Requirements
You need three VMs with docker (>=1.6.0) installed and listening on TCP
port 2375 (see below). You also need to be able to SSH to these VMs without
having to input anything.
The Vagrantfile in this directory constructs three such VMs.
If you are building Weave Net using Vagrant, it is recommended to run the tests from the build VM and not the host.
Running tests
TL;DR: You can run the steps 2. to 7. below with one command:
make PROVIDER=vagrant integration-tests
Detailed steps:
-
Start the build virtual machine (see above article for more details):
vagrant up
-
Start the three testing VMs:
cd test vagrant up
-
SSH into the build VM and go to Weave Net's sources:
cd .. vagrant ssh
you are now on the build VM:
cd ~/weave
-
Compile all code and dependencies:
make make testrunner cd test
-
Upload the weave images from where the
Makefileputs them (weave.tar.gz) to the three docker hosts,docker loadthese, and copies theweavescript over:./setup.sh
-
Run individual tests, e.g.:
./200_dns_test.sh
or run all tests (everything named
*_test.sh):./run_all.sh
-
Stop all VMs:
exit
you are now on your host machine
vagrant destroy -f cd test vagrant destroy -f
Using other VMs
By default the tests assume the Vagrant VMs are used.
To use other VMs, set the environment variable HOSTS to the
space-separated list of IP addresses of the docker hosts, and set the
environment variable SSH to a command that will log into
either (which may just be ssh).
Making docker available over TCP
To make docker listen to a TCP socket, you will usually need to either
run it manually with an option like -H tcp://0.0.0.0:2375; or, for
apt-get installed docker (Ubuntu and Debian), add the line
DOCKER_OPTS="--host unix:///var/run/docker.sock --host tcp://0.0.0.0:2375"
to the file /etc/default/docker, then restart docker.
Updating the GCE test image
When a new version of Docker is released, you willneed to update the GCE test image.
To do this, change the Docker version in run-integration-tests.sh and push the change.
Next build in CircleCI will detect that there is no template for this version of Docker and will first create the template before running tests.
Subsequent builds will then simply re-use the template.