lava-log-process.sh: Extract log processing from squad.sh
squad.sh may be retried multiple time, in case there's a LAVA error.
However, it would be also retried (including LAVA resubmission) in
case there's an error in log extraction scripts. That makes no sense,
so LAVA operations should be clearly separated from other operations.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I2694d67bb974279b28fc4526530f853107dc94d8
diff --git a/tf-a-builder/lava-log-process.sh b/tf-a-builder/lava-log-process.sh
new file mode 100755
index 0000000..68a90ef
--- /dev/null
+++ b/tf-a-builder/lava-log-process.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+set -xe
+
+if [ -f "${WORKSPACE}/lava-raw.log" ]; then
+
+ # Split the UART messages to the corresponding log files
+ ${WORKSPACE}/tf-a-job-configs/tf-a-builder/log-splitter.py "${WORKSPACE}/lava-raw.log"
+
+ # Take possible code coverage trace data from the LAVA log
+ ${WORKSPACE}/tf-a-job-configs/tf-a-builder/feedback-trace-splitter.sh \
+ ${WORKSPACE}/trusted-firmware-a \
+ ${WORKSPACE} \
+ ${WORKSPACE}/artefacts-lava/ \
+ ${TF_GERRIT_REFSPEC}
+
+ # Generate Code Coverate Report in case there are traces available
+ if find covtrace-*.log; then
+ if [ ! -d "${WORKSPACE}/qa-tools" ]; then
+ git clone ${QA_TOOLS_REPO} ${WORKSPACE}/qa-tools
+ fi
+ cd ${WORKSPACE}/qa-tools/coverage-tool/coverage-reporting
+ ./branch_coverage.sh \
+ --config ${WORKSPACE}/config_file.json \
+ --workspace ${WORKSPACE}/trusted-firmware-a \
+ --outdir ${WORKSPACE}/trace_report
+ find ${WORKSPACE}/trace_report
+ fi
+
+fi