From da42f0f046f5093e663ded6426531caf7ea5f295 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Mon, 5 Oct 2015 18:29:21 +0100 Subject: Android: Multinode target side unification CTS and lava-android-test shared almost the same target side YAML files. This change merges both files into one and adds support for USB only devices. To preserve backward compatibility symilnks were created. These should be considered as deprecated and will be removed after all templates are migrated to new YAML files. Change-Id: Ie47eefb2ee5d1872a96925d3d0ec72501ed8fd71 Signed-off-by: Milosz Wasilewski --- android/cts-host.yaml | 16 +++++++++--- android/cts-target.yaml | 39 +---------------------------- android/lava-android-test-host.yaml | 18 ++++++++++---- android/lava-android-test-target.yaml | 33 +----------------------- android/multinode-target.yaml | 47 +++++++++++++++++++++++++++++++++++ android/scripts/adb_connect.sh | 8 ++++++ 6 files changed, 82 insertions(+), 79 deletions(-) mode change 100644 => 120000 android/cts-target.yaml mode change 100644 => 120000 android/lava-android-test-target.yaml create mode 100644 android/multinode-target.yaml create mode 100755 android/scripts/adb_connect.sh (limited to 'android') diff --git a/android/cts-host.yaml b/android/cts-host.yaml index 85252a5..c0a4b03 100644 --- a/android/cts-host.yaml +++ b/android/cts-host.yaml @@ -24,6 +24,10 @@ install: - libc6:i386 - libncurses5:i386 - libstdc++6:i386 + - android-tools-adb + - android-tools-fastboot + steps: + - apt-get install -y $JDK $JRE params: JDK: "default-jdk" @@ -34,15 +38,19 @@ params: run: steps: - - apt-get install -y $JDK $JRE - lava-wait $TEST_NAME-send-ip - IPADDR=`awk -F '=' '{print $2}' /tmp/lava_multi_node_cache.txt` - - export REGEX="([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])" - - echo $IPADDR | grep -P $REGEX - - if [ $? -eq 0 ]; then adb connect $IPADDR; IPADDR=$IPADDR:5555; fi + - if [ $IPADDR != "_MISSING_" ] + - then + - ". ./android/scripts/adb_connect.sh $IPADDR" + - echo $CTS_URL + - echo $IPADDR + - echo $TEST_PARAMS + - adb devices - adb -s $IPADDR wait-for-device - "./android/scripts/cts.py $CTS_URL $IPADDR $TEST_PARAMS" - echo "processes running" - ps + - fi - lava-sync $TEST_NAME-finished diff --git a/android/cts-target.yaml b/android/cts-target.yaml deleted file mode 100644 index a742a7a..0000000 --- a/android/cts-target.yaml +++ /dev/null @@ -1,38 +0,0 @@ -metadata: - name: cts-target - format: "Lava-Test-Shell Test Definition 1.0" - description: "Run CTS on Linaro android. Target side. - The value put in params section in this file is default, user can overwrite them by the values in JSON file." - maintainer: - - milosz.wasilewski@linaro.org - os: - - android - devices: - - panda - - panda-es - - vexpress-a9 - - vexpress-tc2 - - juno - scope: - - functional - -params: - TEST_NAME: "android-cts-5.0-armv8" - - -run: - steps: - - lava-test-case step1-cat-build-info --shell cat /system/build.prop - - SERIALNO=$(getprop ro.serialno) - - IPADDR=$(getprop dhcp.eth0.ipaddress) - - if [ -z $IPADDR ]; then netcfg eth0 up; netcfg eth0 dhcp; IPADDR=$(getprop dhcp.eth0.ipaddress); fi - # if serial number exists it's preferred over IP based adb connection - # This means we're on 'usb only' device with WiFi connectivity - - if [ ! -z $SERIALNO ]; then IPADDR=$SERIALNO; fi - - if [ -z $SERIALNO ]; then lava-test-case step2-get-adb --shell getprop service.adb.tcp.port; fi - - if [ -z $SERIALNO ]; then lava-test-case step3-set-adb --shell setprop service.adb.tcp.port 5555; fi - - lava-test-case step3-set-adb --shell setprop service.adb.root 1 - - lava-test-case step4-stop-adbd --shell stop adbd - - lava-test-case step5-start-adbd --shell start adbd - - lava-test-case step6-send-ip --shell lava-send $TEST_NAME-send-ip ipaddr=$IPADDR - - lava-test-case step7-multinode-sync --shell lava-sync $TEST_NAME-finished diff --git a/android/cts-target.yaml b/android/cts-target.yaml new file mode 120000 index 0000000..db27b47 --- /dev/null +++ b/android/cts-target.yaml @@ -0,0 +1 @@ +multinode-target.yaml \ No newline at end of file diff --git a/android/lava-android-test-host.yaml b/android/lava-android-test-host.yaml index 1993a2a..b9f45b8 100644 --- a/android/lava-android-test-host.yaml +++ b/android/lava-android-test-host.yaml @@ -26,11 +26,17 @@ install: - pip install --upgrade setuptools - cd lava-android-test - python setup.py install + - apt-get install -y $JAVA_PACKAGE deps: - python-pip - python-dev - libyaml-dev - unzip + - libc6:i386 + - libncurses5:i386 + - libstdc++6:i386 + - android-tools-adb + - android-tools-fastboot params: TEST_NAME: "busybox" @@ -39,18 +45,20 @@ params: run: steps: - - apt-add-repository -y http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu - - apt-get update -y - - apt-get install -y android-tools-adb android-tools-fastboot $JAVA_PACKAGE libc6:i386 libncurses5:i386 libstdc++6:i386 - lava-wait $TEST_NAME-${TEST_PARAMS// /_}-send-ip - IPADDR=`awk -F '=' '{print $2}' /tmp/lava_multi_node_cache.txt` - - adb connect $IPADDR - - adb wait-for-device + - if [ $IPADDR != "_MISSING_" ] + - then + - ". ./android/scripts/adb_connect.sh $IPADDR" + - adb devices + - adb -s $IPADDR wait-for-device - lava-android-test install $TEST_NAME - if [[ $TEST_PARAMS != "" ]]; then lava-android-test run -o $TEST_NAME.results -O "$TEST_PARAMS" $TEST_NAME; fi - if [[ $TEST_PARAMS == "" ]]; then lava-android-test run -o $TEST_NAME.results $TEST_NAME; fi - lava-test-run-attach $TEST_NAME.results text/plain - python android/scripts/parse-lat.py -f $TEST_NAME.results -t $TEST_NAME + - ps + - fi - lava-sync $TEST_NAME-${TEST_PARAMS// /_}-finished parse: diff --git a/android/lava-android-test-target.yaml b/android/lava-android-test-target.yaml deleted file mode 100644 index a705e0c..0000000 --- a/android/lava-android-test-target.yaml +++ /dev/null @@ -1,32 +0,0 @@ -metadata: - name: lava-android-test-target - format: "Lava-Test-Shell Test Definition 1.0" - description: "Wrapper around lava-android-test. This is the target part. - It sends the IP address of the target to host and than - waits for the host to execute tests." - maintainer: - - milosz.wasilewski@linaro.org - os: - - android - scope: - - functional - devices: - - panda - - panda-es - - vexpress-a9 - - vexpress-tc2 - - wg - -params: - TEST_NAME: "busybox" - TEST_PARAMS: "" - -run: - steps: - - lava-test-case step1-cat-build-info --shell cat /system/build.prop - - lava-test-case step2-get-adb --shell getprop service.adb.tcp.port - - lava-test-case step3-set-adb --shell setprop service.adb.tcp.port 5555 - - lava-test-case step4-stop-adbd --shell stop adbd - - lava-test-case step5-start-adbd --shell start adbd - - lava-test-case step6-send-ip --shell lava-send $TEST_NAME-${TEST_PARAMS// /_}-send-ip ipaddr=$(getprop dhcp.eth0.ipaddress) - - lava-test-case step7-multinode-sync --shell lava-sync $TEST_NAME-${TEST_PARAMS// /_}-finished diff --git a/android/lava-android-test-target.yaml b/android/lava-android-test-target.yaml new file mode 120000 index 0000000..db27b47 --- /dev/null +++ b/android/lava-android-test-target.yaml @@ -0,0 +1 @@ +multinode-target.yaml \ No newline at end of file diff --git a/android/multinode-target.yaml b/android/multinode-target.yaml new file mode 100644 index 0000000..6b5d3a0 --- /dev/null +++ b/android/multinode-target.yaml @@ -0,0 +1,47 @@ +metadata: + name: multinode-target + format: "Lava-Test-Shell Test Definition 1.0" + description: "Run android test that requires host side. Target side. + The value put in params section in this file is default, user can overwrite them by the values in JSON file. + Test can be used with different host side tests" + maintainer: + - milosz.wasilewski@linaro.org + os: + - android + devices: + - panda + - panda-es + - vexpress-a9 + - vexpress-tc2 + - juno + - mn-nexus9 + scope: + - functional + - performance + +params: + TEST_NAME: "android-cts-5.0-armv8" + # ADB_LINK parameter is used to pass proper device + # identification to the host side. Default is ETH + # which means adb-over-ethernet is used + ADB_LINK: "ETH" + +run: + steps: + - lava-test-case step1-cat-build-info --shell cat /system/build.prop + - SERIALNO=$(getprop ro.serialno) + - IPADDR=$(getprop dhcp.eth0.ipaddress) + - if [ $ADB_LINK != "ETH" ] && [ ! -z $SERIALNO ]; then IPADDR=$SERIALNO; fi + - if [ $ADB_LINK = "ETH" ] && [ ! -z $IPADDR ] + - then + - lava-test-case step2-get-adb --shell getprop service.adb.tcp.port + - lava-test-case step3-set-adb --shell setprop service.adb.tcp.port 5555 + - lava-test-case step4-set-adb-root --shell setprop service.adb.root 1 + - lava-test-case step5-stop-adbd --shell stop adbd + - lava-test-case step6-start-adbd --shell start adbd + - else + # if there is no serial number or IP address available, _MISSING_ is passed to the host + - IPADDR="_MISSING_" + - fi + - lava-test-case step7-send-ip --shell lava-send $TEST_NAME-send-ip ipaddr=$IPADDR + - lava-test-case step8-multinode-sync --shell lava-sync $TEST_NAME-finished diff --git a/android/scripts/adb_connect.sh b/android/scripts/adb_connect.sh new file mode 100755 index 0000000..1416c15 --- /dev/null +++ b/android/scripts/adb_connect.sh @@ -0,0 +1,8 @@ +#!/bin/sh +echo "Checking IP address for $1" +expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' +if [ $? -eq 0 ] +then + adb connect $1 + IPADDR=$1:5555 +fi -- cgit v1.2.3