summaryrefslogtreecommitdiff
path: root/test/compose/README.md
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-12-10 14:34:21 -0700
committerbaude <bbaude@redhat.com>2020-12-11 09:27:42 -0600
commitf3e69d7300e3b4d6c5bb676c1dae27b10c3a4d56 (patch)
tree2b771250d2a6fddae65eeb230cef7cade90999b3 /test/compose/README.md
parent82d7b9f2e21c93cfb12c8f199284c38f3e858280 (diff)
downloadpodman-f3e69d7300e3b4d6c5bb676c1dae27b10c3a4d56.tar.gz
podman-f3e69d7300e3b4d6c5bb676c1dae27b10c3a4d56.tar.bz2
podman-f3e69d7300e3b4d6c5bb676c1dae27b10c3a4d56.zip
test-compose: rewrite to new subdir form
...in which we use all-local tests Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/compose/README.md')
-rw-r--r--test/compose/README.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/compose/README.md b/test/compose/README.md
new file mode 100644
index 000000000..863decf2c
--- /dev/null
+++ b/test/compose/README.md
@@ -0,0 +1,47 @@
+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