mirror of
https://github.com/containers/podman.git
synced 2025-06-18 15:39:08 +08:00
add compose test descriptions
adding compose test descriptions and validations. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
12
test/compose/env_and_volume/README.md
Normal file
12
test/compose/env_and_volume/README.md
Normal file
@ -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
|
@ -1,4 +1,4 @@
|
||||
FROM podman_python
|
||||
FROM quay.io/libpod/podman_python
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
ENTRYPOINT ["python3"]
|
||||
|
4
test/compose/env_and_volume/tests.sh
Normal file
4
test/compose/env_and_volume/tests.sh
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- bash -*-
|
||||
|
||||
test_port 5000 = "done"
|
||||
test_port 5001 = "podman_rulez"
|
@ -1,4 +1,4 @@
|
||||
FROM podman_python
|
||||
FROM quay.io/libpod/podman_python
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
ENTRYPOINT ["python3"]
|
||||
|
5
test/compose/images/README.md
Normal file
5
test/compose/images/README.md
Normal file
@ -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.
|
3
test/compose/images/podman-python/Containerfile
Normal file
3
test/compose/images/podman-python/Containerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM alpine
|
||||
WORKDIR /app
|
||||
RUN apk update && apk add py3-pip && pip3 install flask && rm -fr /var/cache/apk/*
|
9
test/compose/mount_and_label/README.md
Normal file
9
test/compose/mount_and_label/README.md
Normal file
@ -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
|
@ -5,6 +5,6 @@ services:
|
||||
ports:
|
||||
- '5000:5000'
|
||||
volumes:
|
||||
- /tmp/mount:/data:ro
|
||||
- /tmp/data:/data:ro
|
||||
labels:
|
||||
- "io.podman=the_best"
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM podman_python
|
||||
FROM quay.io/libpod/podman_python
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
ENTRYPOINT ["python3"]
|
||||
|
@ -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
|
2
test/compose/mount_and_label/setup.sh
Normal file
2
test/compose/mount_and_label/setup.sh
Normal file
@ -0,0 +1,2 @@
|
||||
mkdir -p /tmp/data
|
||||
echo "Podman rulez!" > /tmp/data/message
|
1
test/compose/mount_and_label/teardown.sh
Normal file
1
test/compose/mount_and_label/teardown.sh
Normal file
@ -0,0 +1 @@
|
||||
rm /tmp/data/message
|
4
test/compose/mount_and_label/tests.sh
Normal file
4
test/compose/mount_and_label/tests.sh
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- bash -*-
|
||||
|
||||
test_port 5000 = "Podman rulez!"
|
||||
podman container inspect -l --format '{{.Config.Labels}}' | grep "the_best"
|
9
test/compose/port_map_diff_port/README.md
Normal file
9
test/compose/port_map_diff_port/README.md
Normal file
@ -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
|
@ -1,4 +1,4 @@
|
||||
FROM podman_python
|
||||
FROM quay.io/libpod/podman_python
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
ENTRYPOINT ["python3"]
|
||||
|
3
test/compose/port_map_diff_port/tests.sh
Normal file
3
test/compose/port_map_diff_port/tests.sh
Normal file
@ -0,0 +1,3 @@
|
||||
# -*- bash -*-
|
||||
|
||||
test_port 5001 = "Podman rulez!"
|
9
test/compose/simple_port_map/README.md
Normal file
9
test/compose/simple_port_map/README.md
Normal file
@ -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
|
@ -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')
|
||||
|
@ -1,3 +1,3 @@
|
||||
# -*- bash -*-
|
||||
|
||||
test_port 5000 = "Podman rulez!--$ENV_PASSTHRU--!"
|
||||
test_port 5000 = "Podman rulez!"
|
||||
|
Reference in New Issue
Block a user