blob: c41851e917ab6be068968dbea904092eff604538 [file] [log] [blame]
Paul Sokolovsky8634f482021-11-10 17:20:59 +03001#!/usr/bin/env bash
2#
3# Copyright (c) 2021, Linaro Limited
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7# Runner for scripts in expect-post/ directory. This script is intended
8# to be run from Jenkins build, with $WORKSPACE set and per-UART test
9# plans prepare in artefacts/debug/run/. See expect-post/README.md for
10# more info about post-expect scripts.
11
12set -e
13
14if [ -z "$WORKSPACE" ]; then
15 echo "Error: WORKSPACE is not set. This script is intended to be run from Jenkins build. (Or suitably set up local env)."
16 exit 1
17fi
18
19total=0
20failed=0
21
22for uartdir in $WORKSPACE/artefacts/debug/run/uart*; do
23 uart=$(basename $uartdir)
24 if [ $uart == "uart0" ]; then
25 continue
26 fi
27 expscript=$(cat $uartdir/expect)
28 if [ ! -f $WORKSPACE/tf-a-ci-scripts/expect-post/$expscript ]; then
29 echo "expect-post/$expscript: MISS"
30 continue
31 fi
32 if ! $WORKSPACE/tf-a-ci-scripts/expect-post/$expscript $WORKSPACE/lava-$uart.log; then
33 echo "expect-post/$expscript($uart): FAIL"
34 failed=$((failed + 1))
35 else
36 echo "expect-post/$expscript($uart): pass"
37 fi
38 total=$((total + 1))
39done
40
41echo "Post expect scripts: total=$total failed=$failed"
42
43if [ $failed -gt 0 ]; then
44 exit 1
45fi