blob: 961a10d7697d9b4187382a7071f936cca47dcfcc [file] [log] [blame]
Milosz Wasilewskida7e5422018-05-08 11:38:25 +01001#!/bin/bash -ex
2# shellcheck disable=SC1090
3
4TEST_DIR=$(dirname "$(realpath "$0")")
5OUTPUT="${TEST_DIR}/output"
6SKIP_INSTALL="false"
7LISA_REPOSITORY="https://github.com/ARM-software/lisa"
8LISA_REF="master"
9LISA_SCRIPT="ipynb/wltests/sched-evaluation-full.py"
10
11usage() {
12 echo "Usage: $0 [-t <lisa_repository_ref>] [-r <lisa_repository>] [-s <lisa_script>] [-S <skip_install>]" 1>&2
13 exit 1
14}
15
16while getopts ":t:r:s:S:" opt; do
17 case "${opt}" in
18 t) LISA_REF="${OPTARG}" ;;
19 r) LISA_REPOSITORY="${OPTARG}" ;;
20 s) LISA_SCRIPT="${OPTARG}" ;;
21 S) SKIP_INSTALL="${OPTARG}" ;;
22 *) usage ;;
23 esac
24done
25
26. "${TEST_DIR}/../../lib/sh-test-lib"
27
28! check_root && error_msg "Please run this test as root."
29cd "${TEST_DIR}"
30create_out_dir "${OUTPUT}"
31RESULT_FILE="${OUTPUT}/result.txt"
32export RESULT_FILE
33
34if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
Chase Qi2d6d8362018-07-24 11:47:17 +080035 info_msg "Dependency and python2 venv installation skipped"
36 test -d .venv || error_msg "python2 venv for LISA is required, but not found!"
37 . .venv/bin/activate
Milosz Wasilewskida7e5422018-05-08 11:38:25 +010038else
Chase Qi2d6d8362018-07-24 11:47:17 +080039 PKGS="virtualenv build-essential autoconf automake libtool pkg-config trace-cmd sshpass kernelshark nmap net-tools tree libfreetype6-dev libpng12-dev python-pip python-dev python-tk"
Milosz Wasilewskida7e5422018-05-08 11:38:25 +010040 install_deps "${PKGS}"
Chase Qi2d6d8362018-07-24 11:47:17 +080041 virtualenv --python=python2 .venv
42 . .venv/bin/activate
43 pip install --quiet matplotlib numpy nose Cython trappy bart-py devlib psutil wrapt scipy IPython
Milosz Wasilewskida7e5422018-05-08 11:38:25 +010044 git clone "${LISA_REPOSITORY}" lisa
45 (
46 cd lisa
47 git checkout "${LISA_REF}"
48 )
49fi
50# TODO: check if lisa directory exists
51cd lisa
52. init_env
53lisa-update submodules
54python "${LISA_SCRIPT}"
55ls
56for FILE in *.csv
57do
58 python "${TEST_DIR}/postprocess_lisa_results.py" -f "${FILE}" -o "${RESULT_FILE}"
59done