From d3463d45d3b55494929a4e764ff6e1179d0013a6 Mon Sep 17 00:00:00 2001 From: Naresh Kamboju Date: Thu, 19 Nov 2015 23:28:29 +0530 Subject: Android: art-microbenchmarks install dependency packages art-microbenchmarks test is been updated to install dependency packages at runtime on host side. Change-Id: I719430c24d7e3a54c1fb64f4bbe97a9f7835b222 Signed-off-by: Naresh Kamboju --- android/art-microbenchmarks.yaml | 3 +++ common/scripts/install-deps.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 common/scripts/install-deps.sh diff --git a/android/art-microbenchmarks.yaml b/android/art-microbenchmarks.yaml index 2079649..fc01f2a 100644 --- a/android/art-microbenchmarks.yaml +++ b/android/art-microbenchmarks.yaml @@ -12,10 +12,13 @@ metadata: - perfomance install: + steps: + - ./common/scripts/install-deps.sh $DEPENDENCIES $JDK $JRE git-repos: - https://android-git.linaro.org/git/linaro/art-testing.git params: + DEPENDENCIES: "android-tools-adb android-tools-fastboot libc6:i386 libncurses5:i386 libstdc++6:i386" JDK: "default-jdk" JRE: "default-jre" TEST_NAME: "art-test" diff --git a/common/scripts/install-deps.sh b/common/scripts/install-deps.sh new file mode 100755 index 0000000..a188bb9 --- /dev/null +++ b/common/scripts/install-deps.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Example: +# ./install-deps.sh android-tools-adb android-tools-fastboot +# Wait for unlock apt function waits for the apt-get process to be completed +# If in case it is already running + +wait_for_unlock_apt () { + RET=1 + while [ $RET -eq 1 ]; do + PID=`pgrep apt-get` + if [ -z $PID ]; then + RET=0 + break + fi + echo "apt-get still running PID: $PID" + sleep 5 + done +} + +# Read each package name from command line arguments +for pkg in ${@} +do + # Check if packages are already installed + STATUS=`dpkg-query -W -f='${Status} \n' $pkg | awk '{print $1}'` + + if [ "$STATUS" == "install" ]; then + echo "==== $pkg package is already installed ====" + else + wait_for_unlock_apt + echo "==== Install $pkg package ====" + apt-get install $pkg + fi +done +exit 0 -- cgit v1.2.3