diff options
author | baude <bbaude@redhat.com> | 2018-09-05 13:49:56 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-09-06 20:54:08 +0000 |
commit | a6811c89fc94adac39da9b3736cf90b7b31b6923 (patch) | |
tree | f1432d0474837d05681035559a1ba1be6da8197d | |
parent | dc025819f40cdf80b607c4218ba9ad5ef96aa0a6 (diff) | |
download | podman-a6811c89fc94adac39da9b3736cf90b7b31b6923.tar.gz podman-a6811c89fc94adac39da9b3736cf90b7b31b6923.tar.bz2 podman-a6811c89fc94adac39da9b3736cf90b7b31b6923.zip |
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.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #1411
Approved by: rhatdan
-rwxr-xr-x | test/test_podman_baseline.sh | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/test/test_podman_baseline.sh b/test/test_podman_baseline.sh index 234c417d5..ca19058fd 100755 --- a/test/test_podman_baseline.sh +++ b/test/test_podman_baseline.sh @@ -11,6 +11,7 @@ # 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 # @@ -20,16 +21,19 @@ ####### 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,31 +155,33 @@ podman images ######## podman rm -a -if [ "$installdocker" -eq 1 ] -then +if [ "$usedocker" -ne 0 ]; then + if [ "$installdocker" -eq 1 ] + then + ######## + # Install Docker, but not for long! + ######## + $package_manager -y install docker + fi + systemctl restart docker + ######## - # Install Docker, but not for long! + # Push fedora-bashecho to the Docker daemon ######## - $package_manager -y install docker -fi -systemctl restart docker - -######## -# Push fedora-bashecho to the Docker daemon -######## -podman push runecho docker-daemon:fedora-bashecho:latest - -######## -# Run fedora-bashecho pull Docker -######## -docker run fedora-bashecho ./tmp/runecho.sh + podman push runecho docker-daemon:fedora-bashecho:latest -if [ "$installdocker" -eq 1 ] -then ######## - # Time to remove Docker + # Run fedora-bashecho pull Docker ######## - $package_manager -y remove docker + docker run fedora-bashecho ./tmp/runecho.sh + + if [ "$installdocker" -eq 1 ] + then + ######## + # Time to remove Docker + ######## + $package_manager -y remove docker + fi fi ######## @@ -213,13 +219,16 @@ fi ######## # Expected to fail ######## -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 ]; -then - echo "Overlay test outside limits passed" -else - echo "Overlay test outside limits failed" + +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 ]; + then + echo "Overlay test outside limits passed" + else + echo "Overlay test outside limits failed" + fi fi ######## |