Fixups for baseline test script
Small amount of clean up on the baseline script to handle failing
on error.  I also added an option to not use docker at all for platoforms
where docker cannot be installed.
Closes:
Approved by: rhatdan
# To run this command:
#
# /bin/bash -v test_podman_baseline.sh -d # Install and then deinstall Docker
+# /bin/bash -v test_podman_baseline.sh -n # Do not perform docker test
# /bin/bash -v test_podman_baseline.sh -e # Stop on error
# /bin/bash -v test_podman_baseline.sh # Continue on error
#
#######
showerror=0
installdocker=0
-while getopts "de" opt; do
+usedocker=1
+while getopts "den" opt; do
case "$opt" in
d) installdocker=1
;;
e) showerror=1
;;
+ n) usedocker=0
+ ;;
esac
done
-if [ "$installdocker" -eq 1 ]
+if [ "$installdocker" -eq 1 ] && [ "usedocker" -ne 0 ]
then
echo "Script will install and then deinstall Docker."
fi
@@ -37,7 +41,7 @@ fi
if [ "$showerror" -eq 1 ]
then
echo "Script will stop on unexpected errors."
- set -eu
+ set -e
fi
pkg_manager=`command -v dnf`
@@ -92,7 +96,7 @@ podman rm --all
podman run --net=host $image dnf -y install java
javaimage=$(podman ps --all -q)
podman commit $javaimage javaimage
-podman run javaimage java
+podman run javaimage java -version
########
# Cleanup containers and images
@@ -151,6 +155,7 @@ podman images
########
podman rm -a
+if [ "$usedocker" -ne 0 ]; then
if [ "$installdocker" -eq 1 ]
then
########
@@ -177,6 +182,7 @@ then
########
$package_manager -y remove docker
fi
+fi
########
# Clean up Podman
@@ -213,6 +219,8 @@ fi
########
# Expected to fail
########
+
+if [ "$showerror" -ne 1 ]; then
podman $PODMANBASE run --security-opt label=disable alpine sh -c 'touch file.txt && dd if=/dev/zero of=file.txt count=1048577 bs=1'
rc=$?
if [ $rc != 0 ];
@@ -221,6 +229,7 @@ then
else
echo "Overlay test outside limits failed"
fi
+fi
########
# Clean up Podman
