summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-12-11 09:17:45 -0600
committerbaude <bbaude@redhat.com>2020-12-11 10:07:13 -0600
commitcb91bf96e02de8a6a7e50f83b4b69b9c47b84cc5 (patch)
tree46e3a7613d8893511bd8112653ea36258936d73c /test
parentf3e69d7300e3b4d6c5bb676c1dae27b10c3a4d56 (diff)
downloadpodman-cb91bf96e02de8a6a7e50f83b4b69b9c47b84cc5.tar.gz
podman-cb91bf96e02de8a6a7e50f83b4b69b9c47b84cc5.tar.bz2
podman-cb91bf96e02de8a6a7e50f83b4b69b9c47b84cc5.zip
add compose test descriptions
adding compose test descriptions and validations. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/compose/env_and_volume/README.md12
-rw-r--r--test/compose/env_and_volume/read/Dockerfile2
-rw-r--r--test/compose/env_and_volume/tests.sh4
-rw-r--r--test/compose/env_and_volume/write/Dockerfile2
-rw-r--r--test/compose/images/README.md5
-rw-r--r--test/compose/images/podman-python/Containerfile3
-rw-r--r--test/compose/mount_and_label/README.md9
-rw-r--r--test/compose/mount_and_label/docker-compose.yml2
-rw-r--r--test/compose/mount_and_label/frontend/Dockerfile2
-rw-r--r--test/compose/mount_and_label/readme.txt5
-rw-r--r--test/compose/mount_and_label/setup.sh2
-rw-r--r--test/compose/mount_and_label/teardown.sh1
-rw-r--r--test/compose/mount_and_label/tests.sh4
-rw-r--r--test/compose/port_map_diff_port/README.md9
-rw-r--r--test/compose/port_map_diff_port/frontend/Dockerfile2
-rw-r--r--test/compose/port_map_diff_port/tests.sh3
-rw-r--r--test/compose/setup.sh.example (renamed from test/compose/simple_port_map/setup.sh)0
-rw-r--r--test/compose/simple_port_map/README.md9
-rw-r--r--test/compose/simple_port_map/frontend/app.py7
-rw-r--r--test/compose/simple_port_map/tests.sh2
-rw-r--r--test/compose/teardown.sh.example (renamed from test/compose/simple_port_map/teardown.sh)0
21 files changed, 68 insertions, 17 deletions
diff --git a/test/compose/env_and_volume/README.md b/test/compose/env_and_volume/README.md
new file mode 100644
index 000000000..e7d74976b
--- /dev/null
+++ b/test/compose/env_and_volume/README.md
@@ -0,0 +1,12 @@
+environment variable and volume
+===============
+
+This test creates two containers both of which are running flask. The first container has
+an environment variable called PODMAN_MSG. That container pipes the contents of PODMAN_MSG
+to a file on a shared volume between the containers. The second container then reads the
+file are returns the PODMAN_MSG value via flask (http).
+
+Validation
+------------
+* curl http://localhost:5000 and verify message
+* curl http://localhost:5001 and verify message
diff --git a/test/compose/env_and_volume/read/Dockerfile b/test/compose/env_and_volume/read/Dockerfile
index a393a0dcb..8d5c45401 100644
--- a/test/compose/env_and_volume/read/Dockerfile
+++ b/test/compose/env_and_volume/read/Dockerfile
@@ -1,4 +1,4 @@
-FROM podman_python
+FROM quay.io/libpod/podman_python
WORKDIR /app
COPY . /app
ENTRYPOINT ["python3"]
diff --git a/test/compose/env_and_volume/tests.sh b/test/compose/env_and_volume/tests.sh
new file mode 100644
index 000000000..a4c8bed30
--- /dev/null
+++ b/test/compose/env_and_volume/tests.sh
@@ -0,0 +1,4 @@
+# -*- bash -*-
+
+test_port 5000 = "done"
+test_port 5001 = "podman_rulez"
diff --git a/test/compose/env_and_volume/write/Dockerfile b/test/compose/env_and_volume/write/Dockerfile
index a393a0dcb..8d5c45401 100644
--- a/test/compose/env_and_volume/write/Dockerfile
+++ b/test/compose/env_and_volume/write/Dockerfile
@@ -1,4 +1,4 @@
-FROM podman_python
+FROM quay.io/libpod/podman_python
WORKDIR /app
COPY . /app
ENTRYPOINT ["python3"]
diff --git a/test/compose/images/README.md b/test/compose/images/README.md
new file mode 100644
index 000000000..f25fbdc24
--- /dev/null
+++ b/test/compose/images/README.md
@@ -0,0 +1,5 @@
+images
+======
+
+Use these directories for images that are needed for the compose testing. These
+images should be then pushed to `quay.io/libpod` for consumption.
diff --git a/test/compose/images/podman-python/Containerfile b/test/compose/images/podman-python/Containerfile
new file mode 100644
index 000000000..47f90afaa
--- /dev/null
+++ b/test/compose/images/podman-python/Containerfile
@@ -0,0 +1,3 @@
+FROM alpine
+WORKDIR /app
+RUN apk update && apk add py3-pip && pip3 install flask && rm -fr /var/cache/apk/*
diff --git a/test/compose/mount_and_label/README.md b/test/compose/mount_and_label/README.md
new file mode 100644
index 000000000..623b38cac
--- /dev/null
+++ b/test/compose/mount_and_label/README.md
@@ -0,0 +1,9 @@
+mount and label
+===============
+
+This test creates a container with a mount (not volume) and also adds a label to the container.
+
+Validation
+------------
+* curl http://localhost:5000 and verify message
+* inspect the container to make the label exists on it
diff --git a/test/compose/mount_and_label/docker-compose.yml b/test/compose/mount_and_label/docker-compose.yml
index 6487067e3..112d7e134 100644
--- a/test/compose/mount_and_label/docker-compose.yml
+++ b/test/compose/mount_and_label/docker-compose.yml
@@ -5,6 +5,6 @@ services:
ports:
- '5000:5000'
volumes:
- - /tmp/mount:/data:ro
+ - /tmp/data:/data:ro
labels:
- "io.podman=the_best"
diff --git a/test/compose/mount_and_label/frontend/Dockerfile b/test/compose/mount_and_label/frontend/Dockerfile
index a393a0dcb..8d5c45401 100644
--- a/test/compose/mount_and_label/frontend/Dockerfile
+++ b/test/compose/mount_and_label/frontend/Dockerfile
@@ -1,4 +1,4 @@
-FROM podman_python
+FROM quay.io/libpod/podman_python
WORKDIR /app
COPY . /app
ENTRYPOINT ["python3"]
diff --git a/test/compose/mount_and_label/readme.txt b/test/compose/mount_and_label/readme.txt
deleted file mode 100644
index bba769c51..000000000
--- a/test/compose/mount_and_label/readme.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-this test creates a container with a mount (not volume) and also adds a label to the container.
-
-validate by curl http://localhost:5000 and message should be same message as piped into the mount message.
-
-also verify the label with podman ps and a filter that only catches that container
diff --git a/test/compose/mount_and_label/setup.sh b/test/compose/mount_and_label/setup.sh
new file mode 100644
index 000000000..8633d65d5
--- /dev/null
+++ b/test/compose/mount_and_label/setup.sh
@@ -0,0 +1,2 @@
+mkdir -p /tmp/data
+echo "Podman rulez!" > /tmp/data/message
diff --git a/test/compose/mount_and_label/teardown.sh b/test/compose/mount_and_label/teardown.sh
new file mode 100644
index 000000000..57867c28a
--- /dev/null
+++ b/test/compose/mount_and_label/teardown.sh
@@ -0,0 +1 @@
+rm /tmp/data/message
diff --git a/test/compose/mount_and_label/tests.sh b/test/compose/mount_and_label/tests.sh
new file mode 100644
index 000000000..07ff089b5
--- /dev/null
+++ b/test/compose/mount_and_label/tests.sh
@@ -0,0 +1,4 @@
+# -*- bash -*-
+
+test_port 5000 = "Podman rulez!"
+podman container inspect -l --format '{{.Config.Labels}}' | grep "the_best"
diff --git a/test/compose/port_map_diff_port/README.md b/test/compose/port_map_diff_port/README.md
new file mode 100644
index 000000000..13ece72ad
--- /dev/null
+++ b/test/compose/port_map_diff_port/README.md
@@ -0,0 +1,9 @@
+port map on different port
+===============
+
+This test creates a container that runs flask on different ports for the container
+and the host
+
+Validation
+------------
+* curl http://localhost:5001 and verify message
diff --git a/test/compose/port_map_diff_port/frontend/Dockerfile b/test/compose/port_map_diff_port/frontend/Dockerfile
index a393a0dcb..8d5c45401 100644
--- a/test/compose/port_map_diff_port/frontend/Dockerfile
+++ b/test/compose/port_map_diff_port/frontend/Dockerfile
@@ -1,4 +1,4 @@
-FROM podman_python
+FROM quay.io/libpod/podman_python
WORKDIR /app
COPY . /app
ENTRYPOINT ["python3"]
diff --git a/test/compose/port_map_diff_port/tests.sh b/test/compose/port_map_diff_port/tests.sh
new file mode 100644
index 000000000..5a468aadc
--- /dev/null
+++ b/test/compose/port_map_diff_port/tests.sh
@@ -0,0 +1,3 @@
+# -*- bash -*-
+
+test_port 5001 = "Podman rulez!"
diff --git a/test/compose/simple_port_map/setup.sh b/test/compose/setup.sh.example
index 9004b1e76..9004b1e76 100644
--- a/test/compose/simple_port_map/setup.sh
+++ b/test/compose/setup.sh.example
diff --git a/test/compose/simple_port_map/README.md b/test/compose/simple_port_map/README.md
new file mode 100644
index 000000000..f28d71c3e
--- /dev/null
+++ b/test/compose/simple_port_map/README.md
@@ -0,0 +1,9 @@
+simple port map to host
+===============
+
+This test creates a container that runs flask on and maps to the same
+host port
+
+Validation
+------------
+* curl http://localhost:5000 and verify message
diff --git a/test/compose/simple_port_map/frontend/app.py b/test/compose/simple_port_map/frontend/app.py
index 97b17c440..e4f84068c 100644
--- a/test/compose/simple_port_map/frontend/app.py
+++ b/test/compose/simple_port_map/frontend/app.py
@@ -4,12 +4,7 @@ app = Flask(__name__)
@app.route('/')
def hello():
- passthru = "ERROR: Could not get $ENV_PASSTHRU envariable"
- try:
- passthru = os.getenv("ENV_PASSTHRU")
- except Exception as e:
- passthru = passthru + ": " + str(e)
- return "Podman rulez!--" + passthru + "--!"
+ return "Podman rulez!"
if __name__ == '__main__':
app.run(host='0.0.0.0')
diff --git a/test/compose/simple_port_map/tests.sh b/test/compose/simple_port_map/tests.sh
index 959b429d6..ccb2b6a3d 100644
--- a/test/compose/simple_port_map/tests.sh
+++ b/test/compose/simple_port_map/tests.sh
@@ -1,3 +1,3 @@
# -*- bash -*-
-test_port 5000 = "Podman rulez!--$ENV_PASSTHRU--!"
+test_port 5000 = "Podman rulez!"
diff --git a/test/compose/simple_port_map/teardown.sh b/test/compose/teardown.sh.example
index 3f8153fa0..3f8153fa0 100644
--- a/test/compose/simple_port_map/teardown.sh
+++ b/test/compose/teardown.sh.example