automated: linux: cyclicdeadline: parse: fix iteration parsing
If iterations > 1, the tests will be named 'iteration-<number>' where
number = iterations that was passed in, so all the other iterations will
be overwritten. mening if iterations=3, then it will look like this:
iteration-3-t0-min-latency: pass
And no iterations-1-* or iterations-2-*.
Solve this by manipulating a temporary file and extend the result file
with the temporary file.
Fixes: 24a05ce87b0f ("automated: linux: cyclicdeadline: add iterations")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
diff --git a/automated/linux/cyclicdeadline/cyclicdeadline.sh b/automated/linux/cyclicdeadline/cyclicdeadline.sh
index 0d8c12c..625c8d0 100755
--- a/automated/linux/cyclicdeadline/cyclicdeadline.sh
+++ b/automated/linux/cyclicdeadline/cyclicdeadline.sh
@@ -9,6 +9,7 @@
OUTPUT="$(pwd)/output"
LOGFILE="${OUTPUT}/cyclicdeadline"
RESULT_FILE="${OUTPUT}/result.txt"
+TMP_RESULT_FILE="${OUTPUT}/tmp_result.txt"
INTERVAL="1000"
STEP="500"
@@ -60,9 +61,10 @@
# Parse test log.
for i in $(seq ${ITERATIONS}); do
../../lib/parse_rt_tests_results.py cyclicdeadline "${LOGFILE}-${i}.json" \
- | tee "${RESULT_FILE}"
+ | tee "${TMP_RESULT_FILE}"
if [ ${ITERATIONS} -ne 1 ]; then
- sed -i "s|^|iteration-${i}-|g" "${RESULT_FILE}"
+ sed -i "s|^|iteration-${i}-|g" "${TMP_RESULT_FILE}"
fi
+ cat "${TMP_RESULT_FILE}" | tee -a "${RESULT_FILE}"
done