51dfcb14ac02eac83d2edffcefda5ca1ff5beb97
[src/qa-testdefinitions.git] / common / scripts / agl-extend-test.sh
1 #!/bin/bash
2
3 pre_check=`which agl-test`
4
5 if [ -n "$pre_check" ] ; then
6     agl-test
7     echo "agl-extend-test is present"
8 else
9     echo "agl-test is not installed, abort this test"
10     exit 127
11 fi
12
13
14 if [ -x ./artiproxy-upload.sh ] ; then
15     LOG_DIR='/var/run/agl-test/logs/log-to-report'
16     ZIP_FILE=`ls ${LOG_DIR} | grep agl-test-log*`
17
18     if [ -z $ZIP_FILE ] ; then
19         echo "Cannot find agl-extend-test log"
20         exit 1
21     fi
22
23     echo "DEBUG: upload LOG_DIR=${LOG_DIR}XXX"
24     echo "DEBUG: upload ZIP_FILE=${ZIP_FILE}XXX"
25
26     ./artiproxy-upload.sh "$LOG_DIR/$ZIP_FILE" "$ZIP_FILE"
27     if [ $? -eq 1 ] ; then
28         echo "Upload of ${ZIP_FILE} failed"
29         exit 1
30     else
31         echo "Upload of test report successful"
32         exit 0
33     fi
34
35 else
36     echo "The file artiproxy-upload.sh does not exist"
37     exit 126
38 fi