From 82d7b9f2e21c93cfb12c8f199284c38f3e858280 Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 2 Dec 2020 08:45:08 -0600 Subject: add compose regression to ci to prevent any regressions, we should be running regression tests using compose. Signed-off-by: baude --- test/compose/env_and_volume/docker-compose.yml | 18 ++++++++++++++++++ test/compose/env_and_volume/read/Dockerfile | 5 +++++ test/compose/env_and_volume/read/app.py | 10 ++++++++++ test/compose/env_and_volume/write/Dockerfile | 5 +++++ test/compose/env_and_volume/write/app.py | 13 +++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 test/compose/env_and_volume/docker-compose.yml create mode 100644 test/compose/env_and_volume/read/Dockerfile create mode 100644 test/compose/env_and_volume/read/app.py create mode 100644 test/compose/env_and_volume/write/Dockerfile create mode 100644 test/compose/env_and_volume/write/app.py (limited to 'test/compose/env_and_volume') diff --git a/test/compose/env_and_volume/docker-compose.yml b/test/compose/env_and_volume/docker-compose.yml new file mode 100644 index 000000000..df906e170 --- /dev/null +++ b/test/compose/env_and_volume/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3' +services: + writer: + environment: + - PODMAN_MSG=podman_rulez + build: write + ports: + - '5000:5000' + volumes: + - data:/data + reader: + build: read + ports: + - '5001:5000' + volumes: + - data:/data +volumes: + data: diff --git a/test/compose/env_and_volume/read/Dockerfile b/test/compose/env_and_volume/read/Dockerfile new file mode 100644 index 000000000..a393a0dcb --- /dev/null +++ b/test/compose/env_and_volume/read/Dockerfile @@ -0,0 +1,5 @@ +FROM podman_python +WORKDIR /app +COPY . /app +ENTRYPOINT ["python3"] +CMD ["app.py"] diff --git a/test/compose/env_and_volume/read/app.py b/test/compose/env_and_volume/read/app.py new file mode 100644 index 000000000..71fbbb26a --- /dev/null +++ b/test/compose/env_and_volume/read/app.py @@ -0,0 +1,10 @@ +from flask import Flask +app = Flask(__name__) + +@app.route('/') +def hello(): + f = open("/data/message", "r") + return f.read() + +if __name__ == '__main__': + app.run(host='0.0.0.0') diff --git a/test/compose/env_and_volume/write/Dockerfile b/test/compose/env_and_volume/write/Dockerfile new file mode 100644 index 000000000..a393a0dcb --- /dev/null +++ b/test/compose/env_and_volume/write/Dockerfile @@ -0,0 +1,5 @@ +FROM podman_python +WORKDIR /app +COPY . /app +ENTRYPOINT ["python3"] +CMD ["app.py"] diff --git a/test/compose/env_and_volume/write/app.py b/test/compose/env_and_volume/write/app.py new file mode 100644 index 000000000..b6ad6fe63 --- /dev/null +++ b/test/compose/env_and_volume/write/app.py @@ -0,0 +1,13 @@ +from flask import Flask +import os +app = Flask(__name__) + +@app.route('/') +def hello(): + f = open("/data/message", "w") + f.write(os.getenv("PODMAN_MSG")) + f.close() + return "done" + +if __name__ == '__main__': + app.run(host='0.0.0.0') -- cgit v1.2.3-54-g00ecf