diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-12 06:50:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 06:50:25 -0500 |
commit | a226e6ed318ae7b7af16081b787cc80718e73e2d (patch) | |
tree | 10844987dfb718524235b497add7bcdaa09e4ece /test/compose/mount_and_label | |
parent | 36bec385f33ebc8f0aeb52547f79bd2663521f8f (diff) | |
parent | cb91bf96e02de8a6a7e50f83b4b69b9c47b84cc5 (diff) | |
download | podman-a226e6ed318ae7b7af16081b787cc80718e73e2d.tar.gz podman-a226e6ed318ae7b7af16081b787cc80718e73e2d.tar.bz2 podman-a226e6ed318ae7b7af16081b787cc80718e73e2d.zip |
Merge pull request #8553 from baude/composeci
add compose regression to ci
Diffstat (limited to 'test/compose/mount_and_label')
-rw-r--r-- | test/compose/mount_and_label/README.md | 9 | ||||
-rw-r--r-- | test/compose/mount_and_label/docker-compose.yml | 10 | ||||
-rw-r--r-- | test/compose/mount_and_label/frontend/Dockerfile | 5 | ||||
-rw-r--r-- | test/compose/mount_and_label/frontend/app.py | 10 | ||||
-rw-r--r-- | test/compose/mount_and_label/setup.sh | 2 | ||||
-rw-r--r-- | test/compose/mount_and_label/teardown.sh | 1 | ||||
-rw-r--r-- | test/compose/mount_and_label/tests.sh | 4 |
7 files changed, 41 insertions, 0 deletions
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 new file mode 100644 index 000000000..112d7e134 --- /dev/null +++ b/test/compose/mount_and_label/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' +services: + web: + build: frontend + ports: + - '5000:5000' + volumes: + - /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 new file mode 100644 index 000000000..8d5c45401 --- /dev/null +++ b/test/compose/mount_and_label/frontend/Dockerfile @@ -0,0 +1,5 @@ +FROM quay.io/libpod/podman_python +WORKDIR /app +COPY . /app +ENTRYPOINT ["python3"] +CMD ["app.py"] diff --git a/test/compose/mount_and_label/frontend/app.py b/test/compose/mount_and_label/frontend/app.py new file mode 100644 index 000000000..bd2794d94 --- /dev/null +++ b/test/compose/mount_and_label/frontend/app.py @@ -0,0 +1,10 @@ +from flask import Flask +app = Flask(__name__) + +@app.route('/') +def hello(): + f = open("/data/message") + return f.read() + +if __name__ == '__main__': + app.run(host='0.0.0.0') 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" |