From 7820de5cfd3243167f2ea8a626dfb06012da5d74 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Mon, 15 Jan 2018 14:02:38 +0000 Subject: [PATCH 01/13] submodules: Update devlib & workload automation to last commit Signed-off-by: Patrick Bellasi --- libs/devlib | 2 +- tools/workload-automation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/devlib b/libs/devlib index 724c0ec8d..f0b58b32c 160000 --- a/libs/devlib +++ b/libs/devlib @@ -1 +1 @@ -Subproject commit 724c0ec8dfc6da8f87d253ebd8020ad35b0ab347 +Subproject commit f0b58b32c4fd7b6dc33c8a3f27fa8918e1023e69 diff --git a/tools/workload-automation b/tools/workload-automation index f9df5195b..b0262e510 160000 --- a/tools/workload-automation +++ b/tools/workload-automation @@ -1 +1 @@ -Subproject commit f9df5195b966366e367725f89ab4234120e3094a +Subproject commit b0262e5103488648c4a5b20cddb42fa2b52104ad -- GitLab From 8ad4e176441dde6039c27b0c73025fbe393d2634 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 16 Jan 2018 11:20:23 +0000 Subject: [PATCH 02/13] utils/env: fix devlib execution on localhost Signed-off-by: Patrick Bellasi --- libs/utils/env.py | 3 ++- tests/lisa/test_wlgen.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/utils/env.py b/libs/utils/env.py index 2cd08b862..ca025c238 100644 --- a/libs/utils/env.py +++ b/libs/utils/env.py @@ -537,7 +537,8 @@ class TestEnv(ShareState): self._log.debug('Setup HOST target...') self.target = devlib.LocalLinuxTarget( platform = platform, - working_directory = self.workdir, + working_directory = '/tmp/devlib-target', + executables_directory = '/tmp/devlib-target/bin', load_default_modules = False, modules = self.__modules, connection_settings = {'unrooted': True}) diff --git a/tests/lisa/test_wlgen.py b/tests/lisa/test_wlgen.py index e585aa480..1d2060c82 100644 --- a/tests/lisa/test_wlgen.py +++ b/tests/lisa/test_wlgen.py @@ -36,6 +36,8 @@ class TestTarget(LocalLinuxTarget): def __init__(self): self.execute_calls = [] super(TestTarget, self).__init__(platform=Platform(), + working_directory = '/tmp/devlib-target', + executables_directory = '/tmp/devlib-target/bin', load_default_modules=False, connection_settings={'unrooted': True}) -- GitLab From 658187683a1590bf44eb6aae6ef84869d4aa0b53 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 16 Jan 2018 14:58:45 +0000 Subject: [PATCH 03/13] tools/wltests: update WA config to use new parameters Since: 987f4ec wa: Rename `update_results` reference to `update_output` the local WA configuration YAML file need to be updated to use the new update_output configuration option. Signed-off-by: Patrick Bellasi --- tools/wa_user_directory/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/wa_user_directory/config.yaml b/tools/wa_user_directory/config.yaml index 7b9579c58..8f1b02655 100644 --- a/tools/wa_user_directory/config.yaml +++ b/tools/wa_user_directory/config.yaml @@ -13,4 +13,4 @@ max_retries: 0 bail_on_init_failure: false # Default result processors -result_processors: ['csv', 'status'] +output_processors: ['csv', 'status'] -- GitLab From 6ce5d89a99b85a0ed06a39d5dcdcc9e6725410a4 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Mon, 15 Jan 2018 14:03:27 +0000 Subject: [PATCH 04/13] tools/wltests: palyback exoplayer movies in LANDSCAPE mode Signed-off-by: Patrick Bellasi --- tools/wltests/agendas/sched-evaluation-full-traced.yaml | 1 + tools/wltests/agendas/sched-evaluation-full.yaml | 1 + tools/wltests/agendas/sched-evaluation-small.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/tools/wltests/agendas/sched-evaluation-full-traced.yaml b/tools/wltests/agendas/sched-evaluation-full-traced.yaml index 8e47901d2..c74f46ee6 100644 --- a/tools/wltests/agendas/sched-evaluation-full-traced.yaml +++ b/tools/wltests/agendas/sched-evaluation-full-traced.yaml @@ -59,6 +59,7 @@ workloads: workload_parameters: format: "mov_720p" duration: 30 + landscape: True # Play 30 seconds of a OGG Vorbis audio with Exoplayer - name: exoplayer diff --git a/tools/wltests/agendas/sched-evaluation-full.yaml b/tools/wltests/agendas/sched-evaluation-full.yaml index 98a4863e2..c939bae3a 100644 --- a/tools/wltests/agendas/sched-evaluation-full.yaml +++ b/tools/wltests/agendas/sched-evaluation-full.yaml @@ -58,6 +58,7 @@ workloads: tag: mov_720p_30s workload_parameters: format: "mov_720p" + landscape: True duration: 30 # Play 30 seconds of a OGG Vorbis audio with Exoplayer diff --git a/tools/wltests/agendas/sched-evaluation-small.yaml b/tools/wltests/agendas/sched-evaluation-small.yaml index 542ddcc20..086fb94c6 100644 --- a/tools/wltests/agendas/sched-evaluation-small.yaml +++ b/tools/wltests/agendas/sched-evaluation-small.yaml @@ -59,6 +59,7 @@ workloads: workload_parameters: format: "mov_720p" duration: 3 + landscape: True # Play 30 seconds of a OGG Vorbis audio with Exoplayer - name: exoplayer -- GitLab From 0b00a252b8b16dd7e4751f9ac0455dbe64a3f999 Mon Sep 17 00:00:00 2001 From: Chris Redpath Date: Fri, 13 Oct 2017 08:29:07 +0100 Subject: [PATCH 05/13] tools/wltests: build: add support for building dtbo.img Some devices have an additional target required, dtbo.img. Add support for building it. Signed-off-by: Chris Redpath --- tools/wltests/build | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/wltests/build b/tools/wltests/build index 6fea5dfc3..af00905b3 100755 --- a/tools/wltests/build +++ b/tools/wltests/build @@ -47,6 +47,7 @@ usage() { -t, --dtbs make dtbs -x, --clean_all make distclean, remove toolchain --modules make modules + --dtbo_image make dtbo.img -a, --use-ccache prepend 'ccache' to CROSS_COMPILE -k, --keepconfig keep exiting .config, i.e. no other config is applied @@ -72,6 +73,7 @@ MAKE_MENUCONFIG=$NO MAKE_SAVEDEFCONFIG=$NO MAKE_KEEPCONFIG=$NO BUILD_DTBS=$NO +BUILD_DTBO_IMAGE=$NO BUILD_MODULES=$NO BUILD_IMAGE=$NO CLEAN_KERNEL=$NO @@ -115,6 +117,9 @@ while [[ $# -gt 0 ]]; do -t|--dtbs) BUILD_DTBS=$YES ;; + --dtbo_image) + BUILD_DTBO_IMAGE=$YES + ;; -x|--clean_all) CLEAN_ALL=$YES ;; @@ -164,6 +169,7 @@ c_info " Keepconfig : $(format_conf ${MAKE_KEEPCONFIG})" c_info " Build full : $(format_conf ${BUILD_NOW})" c_info " Build Image : $(format_conf ${BUILD_IMAGE})" c_info " Build dtbs : $(format_conf ${BUILD_DTBS})" +c_info " Build dtbo.img : $(format_conf ${BUILD_DTBO_IMAGE})" c_info " Build modules : $(format_conf ${BUILD_MODULES})" c_info " Clean : $(format_conf ${CLEAN_KERNEL})" c_info " Distclean : $(format_conf ${DISTCLEAN_KERNEL})" @@ -283,6 +289,11 @@ if [ ${BUILD_DTBS} -eq $YES ]; then (set -x; cd "${KERNEL_SRC}"; make -j${NCPUS} dtbs >${OUT}) fi +if [ ${BUILD_DTBO_IMAGE} -eq $YES ]; then + c_info "Making [dtbo.img]..." + (set -x; cd "${KERNEL_SRC}"; make -j${NCPUS} dtbo.img >${OUT}) +fi + if [ ${BUILD_MODULES} -eq $YES ]; then c_info "Making [modules]..." (set -x; cd "${KERNEL_SRC}"; make -j${NCPUS} modules >${OUT}) -- GitLab From f151f4175d9cde5c9d97b60236a401d43581229b Mon Sep 17 00:00:00 2001 From: Chris Redpath Date: Tue, 17 Oct 2017 09:43:29 +0100 Subject: [PATCH 06/13] tools/wltests: build: add modules_install option to build script Some platforms need to be able to install modules on a target. In order to do that, it is helpful to get the build system to produce module.deps etc. files. We can ask the kernel makefile to install to a directory of our choice by ensuring that we have INSTALL_MOD_PATH in set to something in our environment. If you don't have that set, it defaults to '/' which is normally what you do if installing modules to your local machine. Signed-off-by: Chris Redpath --- tools/wltests/build | 47 ++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tools/wltests/build b/tools/wltests/build index af00905b3..31619859d 100755 --- a/tools/wltests/build +++ b/tools/wltests/build @@ -47,6 +47,7 @@ usage() { -t, --dtbs make dtbs -x, --clean_all make distclean, remove toolchain --modules make modules + --modules_install make modules_install to INSTALL_MOD_PATH --dtbo_image make dtbo.img -a, --use-ccache prepend 'ccache' to CROSS_COMPILE @@ -75,6 +76,7 @@ MAKE_KEEPCONFIG=$NO BUILD_DTBS=$NO BUILD_DTBO_IMAGE=$NO BUILD_MODULES=$NO +BUILD_MODULES_INSTALL=$NO BUILD_IMAGE=$NO CLEAN_KERNEL=$NO DISTCLEAN_KERNEL=$NO @@ -126,7 +128,9 @@ while [[ $# -gt 0 ]]; do --modules) BUILD_MODULES=$YES ;; - + --modules_install) + BUILD_MODULES_INSTALL=$YES + ;; -a|--use-ccache) USE_CCACHE=$YES ;; @@ -163,18 +167,19 @@ format_conf() { # Print information about behavior echo c_info "Build configuration:" -c_info " Menuconfig : $(format_conf ${MAKE_MENUCONFIG})" -c_info " Savedefconfig : $(format_conf ${MAKE_SAVEDEFCONFIG})" -c_info " Keepconfig : $(format_conf ${MAKE_KEEPCONFIG})" -c_info " Build full : $(format_conf ${BUILD_NOW})" -c_info " Build Image : $(format_conf ${BUILD_IMAGE})" -c_info " Build dtbs : $(format_conf ${BUILD_DTBS})" -c_info " Build dtbo.img : $(format_conf ${BUILD_DTBO_IMAGE})" -c_info " Build modules : $(format_conf ${BUILD_MODULES})" -c_info " Clean : $(format_conf ${CLEAN_KERNEL})" -c_info " Distclean : $(format_conf ${DISTCLEAN_KERNEL})" -c_info " Clean all : $(format_conf ${CLEAN_ALL})" -c_info " Use ccache : $(format_conf ${USE_CCACHE})" +c_info " Menuconfig : $(format_conf ${MAKE_MENUCONFIG})" +c_info " Savedefconfig : $(format_conf ${MAKE_SAVEDEFCONFIG})" +c_info " Keepconfig : $(format_conf ${MAKE_KEEPCONFIG})" +c_info " Build full : $(format_conf ${BUILD_NOW})" +c_info " Build Image : $(format_conf ${BUILD_IMAGE})" +c_info " Build dtbs : $(format_conf ${BUILD_DTBS})" +c_info " Build dtbo.img : $(format_conf ${BUILD_DTBO_IMAGE})" +c_info " Build modules : $(format_conf ${BUILD_MODULES})" +c_info " Build modules_install : $(format_conf ${BUILD_MODULES_INSTALL})" +c_info " Clean : $(format_conf ${CLEAN_KERNEL})" +c_info " Distclean : $(format_conf ${DISTCLEAN_KERNEL})" +c_info " Clean all : $(format_conf ${CLEAN_ALL})" +c_info " Use ccache : $(format_conf ${USE_CCACHE})" # Load platform definitions source "${DEFINITIONS_PATH}" @@ -182,11 +187,12 @@ source "${DEFINITIONS_PATH}" # Print information about platform echo c_info "Platform configuration:" -c_info " PLATFORM_NAME : ${PLATFORM_NAME}" -c_info " DEFCONFIG : ${DEFCONFIG}" -c_info " CONFIG_CMD : ${CONFIG_CMD}" -c_info " ARCH : ${ARCH}" -c_info " CROSS_COMPILE : ${CROSS_COMPILE}" +c_info " PLATFORM_NAME : ${PLATFORM_NAME}" +c_info " DEFCONFIG : ${DEFCONFIG}" +c_info " CONFIG_CMD : ${CONFIG_CMD}" +c_info " ARCH : ${ARCH}" +c_info " CROSS_COMPILE : ${CROSS_COMPILE}" +c_info " MODULES_INSTALL_DIR : ${INSTALL_MOD_PATH}" ################################################################################ @@ -299,6 +305,11 @@ if [ ${BUILD_MODULES} -eq $YES ]; then (set -x; cd "${KERNEL_SRC}"; make -j${NCPUS} modules >${OUT}) fi +if [ ${BUILD_MODULES_INSTALL} -eq $YES ]; then + c_info "Making [modules_install] to [${INSTALL_MOD_PATH}] ..." + (set -x; cd "${KERNEL_SRC}"; make -j${NCPUS} modules_install >${OUT}) +fi + if [ ${MAKE_MENUCONFIG} -eq $YES ]; then c_info "Making [menuconfig]..." (set -x; cd "${KERNEL_SRC}"; make menuconfig) -- GitLab From 8e2fb29b50bdf78382a41e2f9643195de362d51a Mon Sep 17 00:00:00 2001 From: Chris Redpath Date: Wed, 18 Oct 2017 13:17:07 +0100 Subject: [PATCH 07/13] tools/wltests: test_series: wake device after reboot Signed-off-by: Chris Redpath --- tools/wltests/test_series | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/wltests/test_series b/tools/wltests/test_series index 8726c6ca7..4534d7dce 100755 --- a/tools/wltests/test_series +++ b/tools/wltests/test_series @@ -492,6 +492,21 @@ device_not_in_adb() { return $EAGAIN } +################################################################################ +# Utility Android commands +################################################################################ +device_wake() { + device_in_adb || return $EAGAIN + $ADB shell input keyevent KEYCODE_MENU + sleep 3 + $ADB shell input keyevent KEYCODE_MENU + return $OK +} +device_not_wake() { + device_wake || return $OK + return $EAGAIN +} + ################################################################################ # DEVICE connection checks ################################################################################ @@ -793,6 +808,15 @@ test_sha1() { fi echo + + c_info "Wakeup the device" + if device_not_wake; then + c_warning "Device not awake, cannot test current kernel" + c_warning "Skipping kernel [$COMMIT_DESC]" + d_notify "Skipping kernel [$COMMIT_DESC]" face-sick + return + fi + c_info "Running tests for [$COMMIT_SHA1: $COMMIT_NAME]..." d_notify "Testing kernel $COMMIT_ID/$COMMITS_COUNT:\n$COMMIT_SHA1: $COMMIT_NAME..." face-tired [ $DRYRUN -eq 1 ] || (set -x; eval $TEST_CMD; set +x) -- GitLab From 84b33b5edb8db6d6ab01512c2ee8b1f59688f02d Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 9 Jan 2018 15:42:46 +0000 Subject: [PATCH 08/13] tools/wltests: test_series: Ensure we enter FATBOOT mode Some devices crash occasionally while rebooting, and lose the reboot reason. This results in them rebooting back into the OS rather than into fastboot. Try to detect if the device has come back up again in normal mode and attempt another reboot bootloader operation. Signed-off-by: Patrick Bellasi Suggested-by: Chris Redpath --- tools/wltests/test_series | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/wltests/test_series b/tools/wltests/test_series index 4534d7dce..0a33857ea 100755 --- a/tools/wltests/test_series +++ b/tools/wltests/test_series @@ -623,6 +623,9 @@ reboot_fastboot() { exit $EIO fi + # Ensure we are in Fatboot more, otheriwse we have to try again... + device_in_fastboot || return $EAGAIN + return $OK } -- GitLab From 00376d41da4a4cc04d60ffaa1c31396b45e44a31 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Wed, 10 Jan 2018 17:55:14 +0000 Subject: [PATCH 09/13] tools/wltests: use multiple attempts when rebooting in FASTBOOT Move fastboot reboot into a dedicated method. Signed-off-by: Patrick Bellasi --- tools/wltests/test_series | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/tools/wltests/test_series b/tools/wltests/test_series index 0a33857ea..3e5831580 100755 --- a/tools/wltests/test_series +++ b/tools/wltests/test_series @@ -573,7 +573,7 @@ boot_not_completed() { ################################################################################ # FASTBOOT mode ################################################################################ -reboot_fastboot() { +enter_fastboot() { seconds=$1 # Check device is connected @@ -590,7 +590,7 @@ reboot_fastboot() { c_info "Device in ADB mode" c_info "Rebooting into bootloader..." - $ADB reboot bootloader + [ $DRYRUN -eq 1 ] || $ADB reboot bootloader echo c_info "Waiting for bootloader up to $REBOOT_TIMEOUT[s]..." @@ -623,12 +623,29 @@ reboot_fastboot() { exit $EIO fi - # Ensure we are in Fatboot more, otheriwse we have to try again... + # Ensure we are in FASTBOOT mode, otheriwse we have to try again... + [ $DRYRUN -eq 0 ] || return $OK device_in_fastboot || return $EAGAIN return $OK } +reboot_fastboot() { + echo + c_info "Rebooting device into FASTBOOT..." + attempts=3 + enter_fastboot; RESULT=$? + while [[ $RESULT -ne OK ]]; do + let attempts-- + if [[ $attempts -eq 0 ]]; then + c_error "device not entering FASTBOOT mode" + exit $EIO + fi + c_warning "Failed entering FASTBOOT mode, $attempts remaining attempts..." + enter_fastboot; RESULT=$? + done +} + ################################################################################ # Build and test a specified SHA1 checkout ################################################################################ @@ -708,21 +725,7 @@ flash_sha1() { build_sha1 "$COMMIT_SHA1" "$COMMIT_DESC"; RESULT=$? [ $RESULT -eq $OK ] || return $RESULT - ### Reboot device into BOOTLOADER - echo - c_info "Rebooting device into bootloader..." - attempts=3 - [ $DRYRUN -eq 1 ] || reboot_fastboot - [ $DRYRUN -eq 1 ] || \ - while [[ $? -eq $ERROR ]]; do - let attempts-- - if [[ $attempts -eq 0 ]]; then - c_error "device not entering FASTBOOT mode" - exit $EIO - fi - c_warning "Failed entering FASTBOOT mode, $attempts remaining attempts..." - reboot_fastboot - done + reboot_fastboot ### Flash generated IMAGES pushd $PLATFORM_PATH/artifacts &>/dev/null -- GitLab From 84676b31850e0c7882459d23ce99a986fec6939b Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Wed, 10 Jan 2018 18:06:45 +0000 Subject: [PATCH 10/13] tools/wltests: use multiple attempts when rebooting into ADB For consistency with the reboot_fastboot method, this adds a similar reboot_adb method which ensure a device is rebooted (if required) to enter ADB mode. Signed-off-by: Patrick Bellasi --- tools/wltests/test_series | 114 ++++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 35 deletions(-) diff --git a/tools/wltests/test_series b/tools/wltests/test_series index 3e5831580..16b4ec196 100755 --- a/tools/wltests/test_series +++ b/tools/wltests/test_series @@ -571,7 +571,7 @@ boot_not_completed() { ################################################################################ -# FASTBOOT mode +# Reboot into different modes ################################################################################ enter_fastboot() { seconds=$1 @@ -646,6 +646,83 @@ reboot_fastboot() { done } +################################################################################ +# ADB mode +################################################################################ +enter_adb() { + + [ $DRYRUN -eq 0 ] || return $OK + + # Check device is connected + if device_not_connected; then + c_error "device not connected" + return $ENODEV + fi + + # Already in adb mode: nothing to do + if device_in_adb; then + c_info "Device already in adb mode, continuing..." + return $OK + fi + + echo + c_info "Device in FASTBOOT mode" + c_info "Booting device..." + [ $DRYRUN -eq 1 ] || $FASTBOOT reboot + + c_info "Waiting up to $REBOOT_TIMEOUT[s] for boot to complete..." + ELAPSED=0 + + #### Wait for device to reboot + [ $DRYRUN -eq 1 ] || \ + until device_in_adb || reboot_timedout; do + usb_disconnect &>/dev/null + sleep 3; let ELAPSED+=3 + usb_connect &>/dev/null + done + echo + if reboot_timedout; then + c_error "device not entering ADB mode" + d_notify "Device reboot TIMEOUT!" face-embarrassed + exit $EIO + fi + c_info "Device in ADB mode" + + ### Wait for boot to complete + [ $DRYRUN -eq 1 ] || \ + until boot_completed || reboot_timedout; do + sleep 3; let ELAPSED+=3 + done + echo + if reboot_timedout; then + c_error "device still booting?!?" + d_notify "Device boot completion TIMEOUT!" face-embarrassed + exit $EIO + fi + + # Ensure we are in ADB mode, otheriwse we have to try again... + [ $DRYRUN -eq 0 ] || return $OK + device_in_adb || return $EAGAIN + + return $OK +} + +reboot_adb() { + echo + c_info "Rebooting device into ADB..." + attempts=3 + enter_adb; RESULT=$? + while [[ $RESULT -ne $OK ]]; do + let attempts-- + if [[ $attempts -eq 0 ]]; then + c_error "device not entering ADB mode" + exit $EIO + fi + c_warning "Failed entering ADB mode, $attempts remaining attempts..." + enter_adb; RESULT=$? + done +} + ################################################################################ # Build and test a specified SHA1 checkout ################################################################################ @@ -734,41 +811,8 @@ flash_sha1() { popd &>/dev/null [ $RESULT -eq $OK ] || return $RESULT - ### Reboot into new kernel - echo - c_info "Reboot new kernel..." - d_notify "Rebooting device..." face-monkey - [ $DRYRUN -eq 1 ] || $FASTBOOT reboot - - c_info "Waiting up to $REBOOT_TIMEOUT[s] for boot to complete..." - ELAPSED=0 - #### Wait for device to reboot - [ $DRYRUN -eq 1 ] || \ - until device_in_adb || reboot_timedout; do - usb_disconnect &>/dev/null - sleep 3; let ELAPSED+=3 - usb_connect &>/dev/null - done - echo - if reboot_timedout; then - c_error "device not entering ADB mode" - d_notify "Device reboot TIMEOUT!" face-embarrassed - exit $EIO - fi - c_info "Device in ADB mode" - - ### Wait for boot to complete - [ $DRYRUN -eq 1 ] || \ - until boot_completed || reboot_timedout; do - sleep 3; let ELAPSED+=3 - done - echo - if reboot_timedout; then - c_error "device still booting?!?" - d_notify "Device boot completion TIMEOUT!" face-embarrassed - exit $EIO - fi + reboot_adb c_info "Boot completed, wait 10[s] more..." sleep 10 # Add an additional safe margin -- GitLab From 6ac81da7ba17d7b21c74f09a96ec02f262534841 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Wed, 10 Jan 2018 18:22:44 +0000 Subject: [PATCH 11/13] tools/wltests: split flash images in two steps To properly flash some devices, it can be required to do some operations in ADB mode before actually rebooting into the bootloader. This allows for example to push new kernel modules on the target before flashing a new kernel image from FASTBOOT mode. This can be achieved by introducing the support for flash_images to be called from two different contexts: 1) ADB mode: with the currently running kernel, so that we can push the modules for a new kernel 2) FASTBOOT mode: when the device has been rebooted into bootloader, and thus we can safely update the kernel image since the modules have been already pushed Signed-off-by: Patrick Bellasi --- .../hikey620_android-4.4/flash_images | 3 +++ .../hikey960_android-4.4/flash_images | 3 +++ tools/wltests/test_series | 21 ++++++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/tools/wltests/platforms/hikey620_android-4.4/flash_images b/tools/wltests/platforms/hikey620_android-4.4/flash_images index 926fde50e..af36af014 100755 --- a/tools/wltests/platforms/hikey620_android-4.4/flash_images +++ b/tools/wltests/platforms/hikey620_android-4.4/flash_images @@ -5,6 +5,9 @@ BASE_DIR="$SCRIPT_DIR/../.." source "${BASE_DIR}/helpers" source "${PLATFORM_PATH}/definitions" +MODE=${$1:-FASTBOOT} +[ $MODE == FASTBOOT ] || exit $OK + ################################################################################ # Build all images required to test a new kernel ################################################################################ diff --git a/tools/wltests/platforms/hikey960_android-4.4/flash_images b/tools/wltests/platforms/hikey960_android-4.4/flash_images index 926fde50e..af36af014 100755 --- a/tools/wltests/platforms/hikey960_android-4.4/flash_images +++ b/tools/wltests/platforms/hikey960_android-4.4/flash_images @@ -5,6 +5,9 @@ BASE_DIR="$SCRIPT_DIR/../.." source "${BASE_DIR}/helpers" source "${PLATFORM_PATH}/definitions" +MODE=${$1:-FASTBOOT} +[ $MODE == FASTBOOT ] || exit $OK + ################################################################################ # Build all images required to test a new kernel ################################################################################ diff --git a/tools/wltests/test_series b/tools/wltests/test_series index 16b4ec196..08a8516ae 100755 --- a/tools/wltests/test_series +++ b/tools/wltests/test_series @@ -802,17 +802,28 @@ flash_sha1() { build_sha1 "$COMMIT_SHA1" "$COMMIT_DESC"; RESULT=$? [ $RESULT -eq $OK ] || return $RESULT - reboot_fastboot - ### Flash generated IMAGES + [ $DRYRUN -eq 0 ] || return $OK pushd $PLATFORM_PATH/artifacts &>/dev/null - [ $DRYRUN -eq 1 ] || $PLATFORM_PATH/flash_images - RESULT=$? - popd &>/dev/null + + # Before: flash images in ADB (e.g. push new modules) + c_info "Flash images from ADB mode..." + reboot_adb + [ $DRYRUN -eq 1 ] || \ + $PLATFORM_PATH/flash_images ADB; RESULT=$? [ $RESULT -eq $OK ] || return $RESULT + # Then: flash images in FASTBOOT mode (e.g. kernel and dtbo images) + c_info "Flash images from FASTBOOT mode..." + reboot_fastboot + [ $DRYRUN -eq 1 ] || \ + $PLATFORM_PATH/flash_images FASTBOOT; RESULT=$? + [ $RESULT -eq $OK ] || return $RESULT + # Flashing completed, check for success... + popd &>/dev/null reboot_adb + c_info "Boot completed, wait 10[s] more..." sleep 10 # Add an additional safe margin -- GitLab From e5b6c427e7550dd6a116e56854995a0d1d32fe4e Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Fri, 12 Jan 2018 17:51:03 +0000 Subject: [PATCH 12/13] tools/wltests: force exit in case of flashing issues On some devices, flashing a new kernel can be a multi-stage operation which can fail on some steps. In these cases, it does not make sense to just skip the kernel and continue with the next one, which is likely to fail for the same reasons. This patch makes test_series completely failing in case an EIO error is reported by one of the target specific flashing scripts. That script is eventually required to warn the user and report the reason of the failure in such a way that a further execution of test_series can successfully flash new kernels. Signed-off-by: Patrick Bellasi --- tools/wltests/test_series | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/wltests/test_series b/tools/wltests/test_series index 08a8516ae..ef99ee5eb 100755 --- a/tools/wltests/test_series +++ b/tools/wltests/test_series @@ -851,8 +851,9 @@ test_sha1() { match_sha1 $COMMIT_SHA1 if [ $? -ne $OK ]; then c_info "Kernel update required!" - flash_sha1 $COMMIT_SHA1 "$COMMIT_DESC" - if [[ $? -ne 0 ]]; then + flash_sha1 $COMMIT_SHA1 "$COMMIT_DESC"; RESULT=$? + [[ $RESULT -ne $EIO ]] || exit $EIO + if [[ $RESULT -ne 0 ]]; then c_warning "Skipping kernel [$COMMIT_DESC]" return fi @@ -860,8 +861,9 @@ test_sha1() { else c_warning "Device not connected via ADB, cannot check current kernel" c_warning "Forcing: build, flashing and reboot selected kernel" - flash_sha1 $COMMIT_SHA1 "$COMMIT_DESC" - if [[ $? -ne 0 ]]; then + flash_sha1 $COMMIT_SHA1 "$COMMIT_DESC"; RESULT=$? + [[ $RESULT -ne $EIO ]] || exit $EIO + if [[ $RESULT -ne 0 ]]; then c_warning "Skipping kernel [$COMMIT_DESC]" d_notify "Skipping kernel [$COMMIT_DESC]" face-sick return -- GitLab From 0a1fbcdfa071651d8d02f005df4cf5921900292d Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Fri, 13 Oct 2017 08:32:14 +0100 Subject: [PATCH 13/13] tools/wltests: add support for Pixel2 (wahoo) This is a set of script to run wltests on a Pixel 2 device. The main difference here wrt Hikey960 devices, is that kernel's modules need to be pused to the device while still in ADB mode, before rebooting into FASTBOOT to update the kernel. A common flow to test on Pixel 2 devices is: - build a tag release of AOSP to get the base images to flash the device. For example, android-8.1.0_r4 is the tag use to test this integartion. - flash and boot the device with AOSP stock images - configure the device for wltest: a) setup networking access b) install APKs required by wltests: https://github.com/ARM-software/lisa/blob/master/tools/wltests/agendas/sched-evaluation-full.yaml c) disable verity to allows / to be remounted RW: adb disable-verity d) reboot your device and ensure "adb remount" does not fails - check which msm-gooogle kernel: https://android.googlesource.com/kernel/msm.git has been used to build the stock images by getting its SHA1 from: adb shell uname -a In the example above, if the previous command should return: Linux localhost 4.4.88-g4e9c66de2183-00019-gb04af4eb2ed4 ... then the base kernel is: b04af4eb2ed4 - rebase your patches on top if the base kernel's SHA1 This should give you a usable and working setup to experiment with Pixel 2 devices. In order to build a Pixel kernel and all the related images, some binary tools are also required which are available in a standard AOSP installation. Thus, if you have a locally installed Android source tree, let assume under AOSP_HOME, here is a suitable configuration for your shell environment: # Your AOSP local installation export AOSP_HOME=/path/to/your/local/AOSP # Android SDK (for ADB and FASTBOOT) export ANDROID_HOME=/data/Android/android-sdk-linux # AOSP Prebuilts (gor GCC and DTC and other tools) export ANDROID_PREBUILTS=$AOSP_HOME/prebuilts export PATH_GCC=$ANDROID_PREBUILTS/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin export PATH_DTC=$ANDROID_PREBUILTS/misc/linux-x86/dtc export PATH_MKI=$ANDROID_PREBUILTS/misc/linux-x86/libufdt export PATH_LZ4=$ANDROID_PREBUILTS/misc/linux-x86/lz4 export PATH=$PATH_GCC:$PATH_DTC:$PATH_MKI:$PATH_LZ4:$PATH # Cross compiler setup export CROSS_COMPILE=aarch64-linux-android- export ARCH=arm64 With this setup in your environment, you'll be ready to run wltests on a Pixel device using a command like, for example: lisa-wltest-series \ --platform wahoo_android_v4.4 \ --kernel_src /path/to/your/wahoo/kernel \ --series /path/to/your/sha1.series \ --wa_agenda tools/wltests/agendas/sched-evaluation-full.yaml \ --results results/wltests_your_experiment_name \ --acme_channels "1 2" \ --device HT7821A00605 --force Signed-off-by: Patrick Bellasi Suggested-by: Chris Redpath --- .../platforms/wahoo_android_v4.4/build_images | 103 ++++++++++++++++++ .../platforms/wahoo_android_v4.4/definitions | 50 +++++++++ .../platforms/wahoo_android_v4.4/flash_images | 96 ++++++++++++++++ 3 files changed, 249 insertions(+) create mode 100755 tools/wltests/platforms/wahoo_android_v4.4/build_images create mode 100644 tools/wltests/platforms/wahoo_android_v4.4/definitions create mode 100755 tools/wltests/platforms/wahoo_android_v4.4/flash_images diff --git a/tools/wltests/platforms/wahoo_android_v4.4/build_images b/tools/wltests/platforms/wahoo_android_v4.4/build_images new file mode 100755 index 000000000..d8bc218f5 --- /dev/null +++ b/tools/wltests/platforms/wahoo_android_v4.4/build_images @@ -0,0 +1,103 @@ +#!/bin/bash + +SCRIPT_DIR=$(dirname $(realpath -s $0)) +BASE_DIR="$SCRIPT_DIR/../.." +source "${BASE_DIR}/helpers" +source "${PLATFORM_PATH}/definitions" + +################################################################################ +# Utils +################################################################################ + +flatten_file() { + OUT_FILE="$1" + + MODULE_DIR=$(dirname $OUT_FILE) + FILE_NAME=$(basename $OUT_FILE) + IN_FILE=$(find . -name $FILE_NAME) + + cat $IN_FILE | \ + while read -r LINE; do + OUT_LINE="" + if [[ "$LINE" != "#"* ]]; then + read -a PARAMS <<< "${LINE}" + for ELEMENT in ${PARAMS[@]}; do + OUT_LINE="${OUT_LINE}$(basename ${ELEMENT}) " + done + OUT_LINE=$(sed 's/ *$//g' <<< ${OUT_LINE}) + else + OUT_LINE=$LINE + fi + echo "${OUT_LINE}" >> ${OUT_FILE} + done +} + +publish_modules() { + MODULE_DIR=$1 + + pushd ${INSTALL_MOD_PATH} + + echo + c_info "Generating modules descriptors:" + for OUT_FILE in modules.dep modules.order modules.alias; do + OUT_FILE="$MODULE_DIR/$OUT_FILE" + c_info "- $OUT_FILE" + flatten_file "$OUT_FILE" + done + + echo + c_info "Installing modules:" + find . -name *.ko | \ + while read KO; do + c_info "- ${MODULE_DIR}/$(basename $KO)" + cp $KO ${MODULE_DIR}/$(basename $KO) + done + + popd +} + +################################################################################ +# Build all images required to test a new kernel +################################################################################ + +echo +c_info "Cleaning ${ARTIFACTS_PATH}..." +rm -rf ${ARTIFACTS_PATH} + +# Local modules installation path +echo +c_info "Build all images and modules..." +export INSTALL_MOD_PATH=${ARTIFACTS_PATH}/modules +mkdir -p ${INSTALL_MOD_PATH} +./build --use-ccache --image --modules --modules_install --dtbo_image --silent; ERROR=$? +[ $ERROR -eq 0 ] || exit $ERROR + +# Check that all required images have been properly created +DTBO_IMAGE=$KERNEL_SRC/arch/arm64/boot/$KERNEL_DTBO +if [ ! -f $DTBO_IMAGE ]; then + c_error "DTB overlay [$DTBO_IMAGE] not generated" + exit $ENOENT +fi +KERNEL_IMAGE=$KERNEL_SRC/arch/arm64/boot/$KERNEL_IMAGE +if [ ! -f $KERNEL_IMAGE ]; then + c_error "Kernel [$KERNEL_IMAGE] not generated" + exit $ENOENT +fi + +echo +c_info "Publishing DTBO image $DTBO_IMAGE to:" +c_info " $ARTIFACTS_PATH/$ANDROID_DTBO_IMAGE" +cp $DTBO_IMAGE $ARTIFACTS_PATH/$ANDROID_DTBO_IMAGE + +echo +c_info "Publishing KERNEL image $KERNEL_IMAGE to:" +c_info " $ARTIFACTS_PATH/$(basename $KERNEL_IMAGE)" +cp $KERNEL_IMAGE $ARTIFACTS_PATH/$(basename $KERNEL_IMAGE) + +echo +MODULE_DIR="$ARTIFACTS_PATH/push_files/vendor/lib/modules" +mkdir -p ${MODULE_DIR} +c_info "Publishing MODULES to:" +c_info " $MODULE_DIR" +publish_modules ${MODULE_DIR} + diff --git a/tools/wltests/platforms/wahoo_android_v4.4/definitions b/tools/wltests/platforms/wahoo_android_v4.4/definitions new file mode 100644 index 000000000..2281faddf --- /dev/null +++ b/tools/wltests/platforms/wahoo_android_v4.4/definitions @@ -0,0 +1,50 @@ + +################################################################################ +# Build definitions for Hikey960 +################################################################################ + +PLATFORM_NAME="Wahoo" + +################################################################################ +# Boot Image Configuration +################################################################################ + +KERNEL_IMAGE="${KERNEL_IMAGE:-Image.lz4-dtb}" +KERNEL_CMDLINE="${KERNEL_CMDLINE:-\ + androidboot.hardware=walleye\ + androidboot.console=ttyMSM0\ + lpm_levels.sleep_disabled=1\ + user_debug=31\ + msm_rtb.filter=0x37\ + ehci-hcd.park=3\ + service_locator.enable=1\ + swiotlb=2048\ + firmware_class.path=/vendor/firmware\ + loop.max_part=7\ + raid=noautodetect\ + buildvariant=userdebug\ +}" +RAMDISK_IMAGE="${RAMDISK_IMAGE:-ramdisk.gz}" # OPM1.170928.003 (4367109) +KERNEL_DTBO="${KERNEL_DTBO:-dtbo.img}" + +ANDROID_BOOT_IMAGE="${ANDROID_BOOT_IMAGE:-boot.img}" +ANDROID_IMAGE_BASE="${ANDROID_IMAGE_BASE:-0x80000000}" +ANDROID_IMAGE_PAGESIZE="${ANDROID_IMAGE_PAGESIZE:-4096}" +ANDROID_OS_VERSION="${ANDROID_OS_VERSION:-O}" +ANDROID_OS_PATCH_LEVEL="${ANDROID_OS_PATCH_LEVEL:-}" + +################################################################################ +# Device Tree Configuration +################################################################################ + +ANDROID_DTBO_IMAGE="${ANDROID_DTBO_IMAGE:-dtbo.img}" + +################################################################################ +# Toolchain Configuration +################################################################################ + +DEFCONFIG="${DEFCONFIG:-wahoo_defconfig}" +CONFIG_CMD="${CONFIG_CMD:-}" +ARCH="${ARCH:-arm64}" +CROSS_COMPILE="${CROSS_COMPILE:-aarch64-linux-android-}" + diff --git a/tools/wltests/platforms/wahoo_android_v4.4/flash_images b/tools/wltests/platforms/wahoo_android_v4.4/flash_images new file mode 100755 index 000000000..b6fa00f09 --- /dev/null +++ b/tools/wltests/platforms/wahoo_android_v4.4/flash_images @@ -0,0 +1,96 @@ +#!/bin/bash + +SCRIPT_DIR=$(dirname $(realpath -s $0)) +BASE_DIR="$SCRIPT_DIR/../.." +source "${BASE_DIR}/helpers" +source "${PLATFORM_PATH}/definitions" + +MODE=${1:-FASTBOOT} + +################################################################################ +# Flash all images required to test a new kernel +################################################################################ + +# Check for DTBO image +ls "${ARTIFACTS_PATH}/${ANDROID_DTBO_IMAGE}" &>/dev/null; ERROR=$? +if [ $ERROR -ne 0 ]; then + c_error "No DTBO image to flash found in $PWD" + exit $ENOENT +fi + +# Check for KERNEL image +ls "${ARTIFACTS_PATH}/${KERNEL_IMAGE}" &>/dev/null; ERROR=$? +if [ $ERROR -ne 0 ]; then + c_error "No KERNEL image to flash found in $PWD" + exit $ENOENT +fi + +# Check for modules to be pushed +MODULE_DIR="${ARTIFACTS_PATH}/push_files/vendor/lib/modules" +ls ${MODULE_DIR}/*.ko &>/dev/null; ERROR=$? +if [ $ERROR -ne 0 ]; then + c_error "No MODULES to push found in $MODULE_DIR" + exit $ENOENT +fi + +case "$MODE" in + +ADB) + echo + c_info "Restart ADB in root mode..." + $ADB root &>/dev/null + + # Verity must be disabled one time, right after the first boot, once a + # new set of stock images has been flashed on the device. + # This check is just there to ensure we can remount root rw, otherwise + # wltests will abort and the device must be rebooted by hand. + c_info "Checking that verity is disabled..." + OUTPUT="$($ADB disable-verity)" + echo + echo "$OUTPUT" + echo + if [[ $OUTPUT != *"verity is already disabled"* ]]; then + c_error "Verity not disabled on this device!" + c_warning "It has been disabled now but you have to" + c_warning "manually reboot your device and restart wltests" + echo + echo + exit $EIO + fi + + c_info "Remounting / rw..." + $ADB remount &>/dev/null; ERROR=$? + if [[ $ERROR -ne 0 ]]; then + c_error "Remount failed" + exit $EIO + fi + sleep 10 + + c_info "Pushing kernel modules..." + $ADB shell rm -rf /vendor/lib/modules + $ADB push ${ARTIFACTS_PATH}/push_files/* / + sleep 5 + + exit $OK + ;; + +FASTBOOT) + echo + c_info "Flashing [$KERNEL_IMAGE] on KERNEL partition..." + $FASTBOOT flash kernel ${ARTIFACTS_PATH}/${KERNEL_IMAGE} + ERROR=$? + [ $ERROR -eq 0 ] || exit -$ERROR + + echo + c_info "Flashing [$ANDROID_DTBO_IMAGE] on DTBO partition..." + $FASTBOOT flash dtbo ${ARTIFACTS_PATH}/${ANDROID_DTBO_IMAGE} + ERROR=$? + [ $ERROR -eq 0 ] || exit -$ERROR + + exit $OK + ;; + +esac + +exit -$EINVAL + -- GitLab