aboutsummaryrefslogtreecommitdiff
path: root/test/test_podman_baseline.sh
diff options
context:
space:
mode:
authoralsadi <alsadi@gmail.com>2019-03-07 09:06:02 +0200
committeralsadi <alsadi@gmail.com>2019-03-07 09:06:02 +0200
commit99ddf512aae2aec633b8d2ee7f40c0f6d88df73c (patch)
treeaf5df344f68a6c6c21448aa1452da868b047cee5 /test/test_podman_baseline.sh
parentf0c146c7726110e5a45a8bbb67de6bc657691ad5 (diff)
downloadpodman-99ddf512aae2aec633b8d2ee7f40c0f6d88df73c.tar.gz
podman-99ddf512aae2aec633b8d2ee7f40c0f6d88df73c.tar.bz2
podman-99ddf512aae2aec633b8d2ee7f40c0f6d88df73c.zip
add test to cover networking
Signed-off-by: alsadi <alsadi@gmail.com>
Diffstat (limited to 'test/test_podman_baseline.sh')
-rwxr-xr-xtest/test_podman_baseline.sh34
1 files changed, 26 insertions, 8 deletions
diff --git a/test/test_podman_baseline.sh b/test/test_podman_baseline.sh
index 27c0c9178..8c4e5a86f 100755
--- a/test/test_podman_baseline.sh
+++ b/test/test_podman_baseline.sh
@@ -78,17 +78,25 @@ echo $image
########
# Run container and display contents in /etc
########
-podman run $image ls -alF /etc
+podman run --rm $image ls -alF /etc
########
-# Run Java in the container - should ERROR but never stop
+# Test networking, bind mounting a file, stdin/stdout redirect
########
-podman run $image java 2>&1 || echo $?
-
-########
-# Clean out containers
-########
-podman rm --all
+txt1="Hello, Podman"
+echo "$txt" > /tmp/hello.txt
+podman run -d --name myweb -p 8080:80 -w /var/www -v /tmp/hello.txt:/var/www/index.txt busybox httpd -f -p 80
+echo $txt | podman exec -i myweb sh -c "cat > /var/www/index2.txt"
+txt2=$( podman exec myweb cat /var/www/index2.txt )
+[ "x$txt1"=="x$txt2" ] && echo "PASS"
+txt2=$( podman run --rm --net host busybox wget -qO - http://localhost:8080/index.txt )
+[ "x$txt1"=="x$txt2" ] && echo "PASS"
+txt2=$( podman run --rm --net host busybox wget -qO - http://localhost:8080/index2.txt )
+[ "x$txt1"=="x$txt2" ] && echo "PASS"
+# poadman run --rm --net container:myweb --add-host myweb:127.0.0.1 busybox wget -qO - http://myweb/index.txt
+rm /tmp/hello.txt
+podman stop myweb
+podman rm myweb
########
# pull and run many containers in parallel, test locks ..etc.
@@ -137,6 +145,16 @@ count=$( podman ps -q | wc -l )
########
+# Run Java in the container - should ERROR but never stop
+########
+podman run $image java 2>&1 || echo $?
+
+########
+# Clean out containers
+########
+podman rm --all
+
+########
# Install java onto the container, commit it, then run it showing java usage
########
podman run --net=host $image dnf -y install java