Skip to content

Commit

Permalink
Update test script to enable testing ssl
Browse files Browse the repository at this point in the history
[#104 state:resolved tagged:@needsdocumentation]
  • Loading branch information
gschueler committed Dec 2, 2010
1 parent 1162938 commit 3dffab6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
13 changes: 12 additions & 1 deletion test/test.sh
Expand Up @@ -72,7 +72,18 @@ fi

rm $DIR/exec.out

sh $DIR/testweb.sh
egrep 'https://' $RDECK_BASE/etc/framework.properties > /dev/null
if [ 0 = $? ] ; then
# call testweb and use -k curl option to ignore server certificate
sh $DIR/testweb.sh "https://localhost:4443" -k
#################
# alternate args to curl to use a pem formatted cert to verify server cert:
#sh $DIR/testweb.sh "https://localhost:4443" "--cacert $RDECK_BASE/etc/rundeck.server.pem"
################
else
sh $DIR/testweb.sh "http://localhost:4440"
fi

if [ 0 != $? ] ; then
echo Failed to run testweb.sh : $!
exit 2
Expand Down
12 changes: 8 additions & 4 deletions test/testweb.sh
Expand Up @@ -15,13 +15,17 @@ fi

# test log in

url='http://localhost:4440'
url=$1
if [ -z "$url" ] ; then
url='http://localhost:4440'
fi
loginurl="${url}/j_security_check"
curlopts=$2

# get main page for login
echo "WEB Starting tests."
echo "WEB Trying login..."
curl -s -S -L -c $DIR/cookies ${url}/menu/index > $DIR/curl.out
curl $curlopts -s -S -L -c $DIR/cookies ${url}/menu/index > $DIR/curl.out
if [ 0 != $? ] ; then
errorMsg "failed menu request to ${url}/menu/index"
exit 2
Expand All @@ -34,7 +38,7 @@ if [ 0 != $? ] ; then
fi


curl -s -S -L -c $DIR/cookies -b $DIR/cookies -d j_username=admin -d j_password=admin $loginurl > $DIR/curl.out
curl $curlopts -s -S -L -c $DIR/cookies -b $DIR/cookies -d j_username=admin -d j_password=admin $loginurl > $DIR/curl.out
if [ 0 != $? ] ; then
errorMsg "failed login request to ${loginurl}"
exit 2
Expand All @@ -55,7 +59,7 @@ fi
echo "WEB Login OK"
echo "WEB Testing Nodes..."
# get nodes page
curl -s -S -L -c $DIR/cookies -b $DIR/cookies ${url}/resources/nodes?project=test > $DIR/curl.out
curl $curlopts -s -S -L -c $DIR/cookies -b $DIR/cookies ${url}/resources/nodes?project=test > $DIR/curl.out
if [ 0 != $? ] ; then
errorMsg "failed nodes request"
exit 2
Expand Down

0 comments on commit 3dffab6

Please sign in to comment.