From 2112847349766cf1768ff532bf9cba47edc4d4c0 Mon Sep 17 00:00:00 2001 From: Pall Sigurdsson Date: Fri, 6 Dec 2013 15:49:07 +0000 Subject: [PATCH] test script added --- check_storwize/test.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 check_storwize/test.sh diff --git a/check_storwize/test.sh b/check_storwize/test.sh new file mode 100644 index 0000000..ffa3ac4 --- /dev/null +++ b/check_storwize/test.sh @@ -0,0 +1,33 @@ +CURRENT_PATH=`pwd` +cd $CURRENT_PATH/tests/ok +tests=`echo * | sed 's/.txt//g'` +for i in $tests ; do + command="python $CURRENT_PATH/check_storwize.py --test -H testhost -U nagios -Q $i" + $command > /dev/null 2>&1 + RESULT=$? + if [ $RESULT -ne 0 ]; then + echo "FAIL" + echo "cd `pwd`" + echo "Command: $command" + else + echo "$i working as expected" + fi +done + + +cd $CURRENT_PATH/tests/critical +tests=`echo * | sed 's/.txt//g'` +for i in $tests ; do + command="python $CURRENT_PATH/check_storwize.py --test -H testhost -U nagios -Q $i" + $command > /dev/null 2>&1 + RESULT=$? + if [ $RESULT -ne 2 ]; then + echo "FAIL" + echo "cd `pwd`" + echo "Command: $command" + else + echo "$i working as expected" + fi +done + +