summaryrefslogtreecommitdiff
path: root/automated/linux/aep-pre-post/lisa.sh
diff options
context:
space:
mode:
Diffstat (limited to 'automated/linux/aep-pre-post/lisa.sh')
-rwxr-xr-xautomated/linux/aep-pre-post/lisa.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/automated/linux/aep-pre-post/lisa.sh b/automated/linux/aep-pre-post/lisa.sh
new file mode 100755
index 0000000..a592ec1
--- /dev/null
+++ b/automated/linux/aep-pre-post/lisa.sh
@@ -0,0 +1,57 @@
+#!/bin/bash -ex
+# shellcheck disable=SC1090
+
+TEST_DIR=$(dirname "$(realpath "$0")")
+OUTPUT="${TEST_DIR}/output"
+SKIP_INSTALL="false"
+LISA_REPOSITORY="https://github.com/ARM-software/lisa"
+LISA_REF="master"
+LISA_SCRIPT="ipynb/wltests/sched-evaluation-full.py"
+
+usage() {
+ echo "Usage: $0 [-t <lisa_repository_ref>] [-r <lisa_repository>] [-s <lisa_script>] [-S <skip_install>]" 1>&2
+ exit 1
+}
+
+while getopts ":t:r:s:S:" opt; do
+ case "${opt}" in
+ t) LISA_REF="${OPTARG}" ;;
+ r) LISA_REPOSITORY="${OPTARG}" ;;
+ s) LISA_SCRIPT="${OPTARG}" ;;
+ S) SKIP_INSTALL="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+
+. "${TEST_DIR}/../../lib/sh-test-lib"
+
+! check_root && error_msg "Please run this test as root."
+cd "${TEST_DIR}"
+create_out_dir "${OUTPUT}"
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
+
+if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
+ info_msg "Dependency installation skipped"
+else
+ PKGS="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"
+ install_deps "${PKGS}"
+ pip install --upgrade --quiet pip && hash -r
+ pip install --upgrade --quiet setuptools
+ pip install --upgrade --quiet matplotlib numpy nose Cython trappy bart-py devlib psutil wrapt scipy IPython
+ git clone "${LISA_REPOSITORY}" lisa
+ (
+ cd lisa
+ git checkout "${LISA_REF}"
+ )
+fi
+# TODO: check if lisa directory exists
+cd lisa
+. init_env
+lisa-update submodules
+python "${LISA_SCRIPT}"
+ls
+for FILE in *.csv
+do
+ python "${TEST_DIR}/postprocess_lisa_results.py" -f "${FILE}" -o "${RESULT_FILE}"
+done