podman/test/compose
Brent Baude daebdf3859 Add container config to compat image inspect
With docker-compose, there is a use case where you can `docker-compose
up -d`, then change a file like docker-compose.yml and run up again.
This requires a ContainerConfig with at least Volumes be populated in
the inspect data.  This PR adds just that.

Fixes: #10795

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-07-09 10:10:04 -05:00
..
env_and_volume add compose test descriptions 2020-12-11 10:07:13 -06:00
images add compose test descriptions 2020-12-11 10:07:13 -06:00
ipam_set_ip Fixes docker-compose cannot set static ip when use ipam 2021-05-06 19:25:27 +08:00
mount_and_label Add new docker-compose test for two networks 2021-04-01 17:27:03 +02:00
port_map_diff_port add compose test descriptions 2020-12-11 10:07:13 -06:00
simple_port_map add compose test descriptions 2020-12-11 10:07:13 -06:00
slirp4netns_opts Parse slirp4netns net options with compat api 2021-04-23 11:48:50 +02:00
two_networks Add new docker-compose test for two networks 2021-04-01 17:27:03 +02:00
uptwice Add container config to compat image inspect 2021-07-09 10:10:04 -05:00
README.md test-compose: rewrite to new subdir form 2020-12-11 09:27:42 -06:00
setup.sh.example add compose test descriptions 2020-12-11 10:07:13 -06:00
teardown.sh.example add compose test descriptions 2020-12-11 10:07:13 -06:00
test-compose Fix network connect race with docker-compose 2021-06-11 16:00:12 +02:00

README.md

Tests for docker-compose

This directory contains tests for docker-compose under podman.

Each subdirectory must contain one docker-compose.yml file along with all necessary infrastructure for it (e.g. Containerfile, any files to be copied into the container, and so on.

The test-compose script will, for each test subdirectory:

  • set up a fresh podman root under an empty working directory;
  • run a podman server rooted therein;
  • cd to the test subdirectory, and run docker-compose up -d;
  • source tests.sh;
  • run docker-compose down.

As a special case, setup.sh and teardown.sh in the test directory will contain commands to be executed prior to docker-compose up and after docker-compose down respectively.

tests.sh will probably contain commands of the form

 test_port 12345 = 'hello there'

Where 12345 is the port to curl to; '=' checks equality, '~' uses expr to check substrings; and 'hello there' is a string to look for in the curl results.

Usage:

$ sudo test/compose/test-compose [pattern]

By default, all subdirs will be run. If given a pattern, only those subdirectories matching 'pattern' will be run.

If $COMPOSE_WAIT is set, test-compose will pause before running docker-compose down. This can be helpful for you to debug failing tests:

$ env COMPOSE_WAIT=1 sudo --preserve-env=COMPOSE_WAIT test/compose/test-compose

Then, in another window,

# ls -lt /var/tmp/
# X=/var/tmp/test-compose.tmp.XXXXXX <--- most recent results of above
# podman --root $X/root --runroot $X/runroot ps -a
# podman --root $X/root --runroot $X/runroot logs -l