Files
weave/test
Tom Wilkie 13f1239a3e Various improvements to unit test running
- units.sh should exit on error.
- Add race detector to unit test runner.
- Use local testing/cover/cover tool in gen_coverage_report.sh and units.sh
- Use the scheduler to parallelise the unit tests.
- Make test run id a string and differentiate between unit runs and integration runs in the scheduler.
- Pipe circle env vars through to build container so we can detect when to use the scheduler
- Add python requests to the weave build container.
- Quote test names in urls, make flask handle url segments with slashes in.
2015-07-13 09:33:52 +00:00
..
2015-06-05 13:23:14 +01:00
2015-07-04 02:53:36 +01:00
2015-06-26 11:10:08 +01:00
2015-07-11 12:15:46 +01:00

This directory contains integration tests for weave.

Requirements

You need two VMs with docker >=1.3.1 installed and listening on TCP port 2375 (see below). You also need to be able to ssh to these VMs, preferably without having to input anything.

The Vagrantfile in this directory constructs two such VMs.

To create the VMs, open a shell and in this directory and type

vagrant up

To meet the aforementioned ssh requirement you may want to

cp ~/.vagrant.d/insecure_private_key .

Running tests

If you are building weave using Vagrant, it is recommended to run the tests from the build VM and not the host.

./setup.sh

uploads the weave images from where the Makefile puts them (/var/tmp) to the two docker hosts, and copies the weave script over.

Then you can use, e.g.,

./200_dns_test.sh

to run an individual test, or

./run_all.sh

to run everything named *_test.sh.

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.