mirror of https://github.com/containers/podman.git
add compose test descriptions
adding compose test descriptions and validations. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
parent
f3e69d7300
commit
cb91bf96e0
|
@ -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"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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.
|
|
@ -0,0 +1,3 @@
|
|||
FROM alpine
|
||||
WORKDIR /app
|
||||
RUN apk update && apk add py3-pip && pip3 install flask && rm -fr /var/cache/apk/*
|
|
@ -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
|
|
@ -0,0 +1,2 @@
|
|||
mkdir -p /tmp/data
|
||||
echo "Podman rulez!" > /tmp/data/message
|
|
@ -0,0 +1 @@
|
|||
rm /tmp/data/message
|
|
@ -0,0 +1,4 @@
|
|||
# -*- bash -*-
|
||||
|
||||
test_port 5000 = "Podman rulez!"
|
||||
podman container inspect -l --format '{{.Config.Labels}}' | grep "the_best"
|
|
@ -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"]
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# -*- bash -*-
|
||||
|
||||
test_port 5001 = "Podman rulez!"
|
|
@ -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!"
|
||||
|
|
Loading…
Reference in New Issue