From 351363f7d9da8c524fa0138cae5be3ad55f04285 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 26 Aug 2014 11:31:19 +0000 Subject: added run_tests --- leap-platform-test | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'leap-platform-test') diff --git a/leap-platform-test b/leap-platform-test index f49630b..1b1f131 100755 --- a/leap-platform-test +++ b/leap-platform-test @@ -183,6 +183,7 @@ reset_deploy() { # have finished echo "Waiting for last deploy process has finished..." wait + if [ ! -e $deploy_failure -a -n $MAIL_TO ] then @@ -192,7 +193,6 @@ reset_deploy() { echo "Sending success mail to $MAIL_TO" printf "$msg" | /usr/sbin/sendmail -t - fi } @@ -202,6 +202,27 @@ ssh_up () { return $? } +run_tests () { + + date=`date +"%F-%H%M%S"` + TEST_FILTER='net.ssh.authentication.agent.*could not connect to ssh-agent' + + + echo -e "\nRunning leap test on `date`" | tee -a $LOG1 $LOG2 + $LEAP_CMD $OPTS test 2>&1 | egrep -v "$TEST_FILTER" | tee -a $LOG1 $LOG2 + #$LEAP_CMD $OPTS test 2>&1 + test_failure=$? + + if [ $? -ne 0 ] + then + echo 'WARNING - "leap test" failed !' | tee -a $LOG1 $LOG2 + else + echo 'OK - "leap test" is all green !' | tee -a $LOG1 $LOG2 + fi + return $test_failure + +} + update_leap_cli () { cd $LEAP_SRC git pull @@ -301,6 +322,8 @@ done cmd=$1 shift nodelist=$@ +TEST_LOG1="$LOGDIR/test.log" +TEST_LOG2="$LOGDIR/test-$date.log" #echo "config: $config" #echo "cmd: $cmd" @@ -361,6 +384,7 @@ case $cmd in create_provider) create_provider;; deploy) deploy "$nodes";; reset_deploy) reset_deploy "$nodes";; + test) run_tests "$nodes";; (*) usage; echo "Please specify a command."; exit 1;; esac -- cgit v1.2.3