32010430d8ed0051465b8f4ced5383b050917799 max Tue Jun 6 11:59:15 2017 -0700 adding smoke test script, for Hiram, no redmine diff --git src/utils/cgiSmokeTest src/utils/cgiSmokeTest new file mode 100755 index 0000000..4110e2b --- /dev/null +++ src/utils/cgiSmokeTest @@ -0,0 +1,72 @@ +#!/bin/bash -e + +# to debug this script, run it with bash -x + +set -o pipefail +set -o errtrace + +function usage { + + cat <<EOM +Usage: $(basename "$0") [OPTION]... + + -a VALUE argument description + line two + line three + -d switch description + -h display help +EOM + + exit 2 +} + +errorHandler() { + echo ERROR $? + rm -f /tmp/smokeTest.tmp + exit 1 +} + +# a function, so we can replace this with curl one day +# some distros have only curl, others only wget by default +function getPage { + wget -q -O - $* +} + +# init switch flags +a=0 +d=0 + +while getopts ":adh" optKey; do + case $optKey in + a) + a=$OPTARG + ;; + b) + b=$OPTARG + ;; + h|*) + usage + ;; + esac +done + +shift $((OPTIND - 1)) + +#echo "Processed:" +#echo "d=$d" +#echo +#echo "A total of $# args remain:" +#echo "$*" +trap errorHandler ERR + +baseUrl=$1 + +echo Testing hgGeneGraph +# check if the page loads correctly up to the end +getPage ${baseUrl}'/cgi-bin/hgGeneGraph?gene=MTOR' | grep -i "Data Information" > /dev/null + +echo Testing hgGeneGraph image +# check the image +getPage ${baseUrl}/trash/geneGraph/MTOR_e9223a301250fc1e9d81.png | identify /dev/stdin | grep 'PNG 1095x480' > /dev/null + +exit 0