(Created page with " = Description = A simple validation test case for Podman on Fedora IoT Edition. = Setup = This testcase can be run on either an image or installation, on hardware or in virtu...") |
|||
(19 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
= How to test = | = How to test = | ||
Boot image or Installation and log in locally or SSH into booted image. | Boot image or Installation and log in locally or SSH into booted image. For this test, use a regular user account to ensure rootless podman is working. | ||
Check if podman is installed | Check if podman is installed | ||
Line 12: | Line 12: | ||
Check to see if you can pull an image from the registry | Check to see if you can pull an image from the registry | ||
podman pull fedora | podman pull registry.fedoraproject.org/fedora:latest | ||
Note when testing aarch64 you may need to include '--override-arch arm64' due to this [https://bugzilla.redhat.com/show_bug.cgi?id=1793927 bug] | |||
Run hello-world to test. | |||
podman run -it - | podman run -it registry.fedoraproject.org/fedora:latest echo Hello-World | ||
= | = Create a container from Dockerfile = | ||
For this test you can | For this test you can use a Dockerfile of your own or use this basic example below: | ||
<pre> | <pre> | ||
cat << EOF >> Dockerfile | |||
FROM fedora:latest | FROM registry.fedoraproject.org/fedora:latest | ||
RUN /usr/bin/dnf install -y httpd | RUN /usr/bin/dnf install -y httpd | ||
EXPOSE 80 | EXPOSE 80 | ||
CMD ["-D", "FOREGROUND"] | CMD ["-D", "FOREGROUND"] | ||
ENTRYPOINT ["/usr/sbin/httpd"] | ENTRYPOINT ["/usr/sbin/httpd"] | ||
EOF | |||
</pre> | </pre> | ||
Build an image | Build an image | ||
sudo podman build $(pwd) | sudo podman build -t fedora-httpd $(pwd) | ||
Verify the image | Verify the image | ||
podman images | sudo podman images | ||
Run container | Run the container | ||
podman run -d -p 80:80 | sudo podman run -d -p 80:80 localhost/fedora-httpd | ||
Verify the container is running | |||
firewall-cmd --permanent --zone=trusted --add-interface= | sudo podman container ls | ||
Test apache is working, this should display the Test page html. | |||
curl http://localhost/ | |||
Open the firewall to accept connections on port 80 | |||
firewall-cmd --permanent --zone=trusted --add-interface=cni-podman0 | |||
firewall-cmd --permanent --zone=trusted --add-port=80/tcp | |||
Open a web browser and test the page is visible | Open a web browser on another computer and enter the IP address to test the page is visible. | ||
= Results= | = Results= | ||
Line 53: | Line 57: | ||
# podman is installed | # podman is installed | ||
# Hello World is displayed | # Hello World is displayed | ||
# Custom container created, httpd test page visible on a browser or using curl. | # Custom container created, httpd test page visible on a browser or using curl. |
Latest revision as of 18:20, 6 May 2020
Description
A simple validation test case for Podman on Fedora IoT Edition.
Setup
This testcase can be run on either an image or installation, on hardware or in virtualization.
How to test
Boot image or Installation and log in locally or SSH into booted image. For this test, use a regular user account to ensure rootless podman is working.
Check if podman is installed
rpm -q podman
Check to see if you can pull an image from the registry
podman pull registry.fedoraproject.org/fedora:latest
Note when testing aarch64 you may need to include '--override-arch arm64' due to this bug
Run hello-world to test.
podman run -it registry.fedoraproject.org/fedora:latest echo Hello-World
Create a container from Dockerfile
For this test you can use a Dockerfile of your own or use this basic example below:
cat << EOF >> Dockerfile FROM registry.fedoraproject.org/fedora:latest RUN /usr/bin/dnf install -y httpd EXPOSE 80 CMD ["-D", "FOREGROUND"] ENTRYPOINT ["/usr/sbin/httpd"] EOF
Build an image
sudo podman build -t fedora-httpd $(pwd)
Verify the image
sudo podman images
Run the container
sudo podman run -d -p 80:80 localhost/fedora-httpd
Verify the container is running
sudo podman container ls
Test apache is working, this should display the Test page html.
curl http://localhost/
Open the firewall to accept connections on port 80
firewall-cmd --permanent --zone=trusted --add-interface=cni-podman0 firewall-cmd --permanent --zone=trusted --add-port=80/tcp
Open a web browser on another computer and enter the IP address to test the page is visible.
Results
- Latest image pulled successfully from the Registry
- podman is installed
- Hello World is displayed
- Custom container created, httpd test page visible on a browser or using curl.