diff options
author | 2019-04-19 14:30:35 +0200 | |
---|---|---|
committer | 2019-05-02 12:20:20 +0000 | |
commit | 485d5d46aa38e5e4169da75a673b387cb73df73f (patch) | |
tree | 168440ee35265832c38b1cad555f62190a970221 /jjb/common/include-agl-lava-jobs-submit.sh | |
parent | ac8b12317de853b669161d5c524913c86597ccee (diff) |
Fix the URL to send the email report
The 'LAVA_MASTER_URI' used is wrong, this patch fixes the url.
It adds also a check on the output of lavacli command before to send the
test email report.
Signed-off-by: Khouloud Touil <ktouil@baylibre.com>
(cherry picked from commit d891414424913e7bcf2845740cd5c532a858877e)
Change-Id: Iff4b984593abb5ccb495764246826bcf173e6e6e
Diffstat (limited to 'jjb/common/include-agl-lava-jobs-submit.sh')
-rw-r--r-- | jjb/common/include-agl-lava-jobs-submit.sh | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/jjb/common/include-agl-lava-jobs-submit.sh b/jjb/common/include-agl-lava-jobs-submit.sh index 07001e5e..bf4f478d 100644 --- a/jjb/common/include-agl-lava-jobs-submit.sh +++ b/jjb/common/include-agl-lava-jobs-submit.sh @@ -95,14 +95,17 @@ if [ -z "$KCI_EMAIL_AUTH_TOKEN" ]; then TREE_NAME=$(grep kernel.tree: $JOB_FILE_NEW | sed 's,[[:space:]],,g' | cut -d: -f2) BRANCH=$(grep git.branch: $JOB_FILE_NEW | sed 's,[[:space:]],,g' | cut -d: -f2) GIT_DESCRIBE="$(grep kernel.version: $JOB_FILE_NEW | sed 's,[[:space:]],,g' | cut -d: -f2)" - lavacli --uri $LAVA_MASTER_URI results $job_id | grep '* [0-9]' |cut -d_ -f2- |cut -d. -f1 | sort | uniq > test_plans - if [ $? -eq 0 ] && [ -s test_plans ]; then - for plan in $(<test_plans); do - curl -X POST -H "Authorization: $KCI_EMAIL_AUTH_TOKEN" -H "Content-Type: application/json" -d '{"job": "'$TREE_NAME'", "kernel": "'$GIT_DESCRIBE'", "git_branch": "'$BRANCH'", "report_type": "test", "plan": "'$plan'", "send_to": [" automotive-testreports@lists.linuxfoundation.org"], "format": ["txt"], "delay": 3600}' ${KCI_API}/send - echo "The test email reportS will be sent with a delay of 1 hour " - done - else - echo "There is no test plan identified" + lavacli -i $lab results $job_id > test_plan.raw + if [ $? -eq 0 ]; then + grep '* [0-9]' test_plan.raw |cut -d_ -f2- |cut -d. -f1 | sort | uniq > test_plans + if [ $? -eq 0 ] && [ -s test_plans ]; then + for plan in $(<test_plans); do + curl -X POST -H "Authorization: $KCI_EMAIL_AUTH_TOKEN" -H "Content-Type: application/json" -d '{"job": "'$TREE_NAME'", "kernel": "'$GIT_DESCRIBE'", "git_branch": "'$BRANCH'", "report_type": "test", "plan": "'$plan'", "send_to": [" automotive-testreports@lists.linuxfoundation.org"], "format": ["txt"], "delay": 3600}' ${KCI_API}/send + echo "The test email reportS will be sent with a delay of 1 hour " + done + else + echo "There is no test plan identified" + fi fi fi # after one successful submit, we're done |