SlideShare a Scribd company logo
1 of 53
Download to read offline
Introduction of Unit Test
      on Android Kernel

            Jiahe Jou, 2012/11/22
Revisions
  DATE       AUTHOR               DESCRIPTION

2012/11/13   Jiahe Jou   Draft.
Outlines
●   OMAP DDT Overview

●   Compile and Installation

●   Pre-requirement

●   Run Test

●   Automation Tool

●   Customization

●   Utilities
OMAP DDT Overview
●   OMAP DDT(Device Driver Test)
    ○   Device driver testing framework for OMAP Linux kernel
    ○   Part of Linux OMAP Project

●   Repository location
    ○   Old: git://dev.omapzoom.org/pub/scm/richo/device_driver_test.git
    ○   New: git://gitorious.org/omap-ddt/omap-ddt.git

●   Current branches
    ○   master
    ○   ddt-2.6.35
    ○   ddt-2.6.39
    ○   ddt-3.0
OMAP DDT Overview
●   First commit
OMAP DDT Overview
●   Current owner




●   Committer
    ○   Leed Aguilar, leedsalim@gmail.com
    ○   Dmytro Kedrovskyi, x0158318@ti.com
    ○   Mariia Nagul, x0171643@ti.com
OMAP DDT Overview
●   Every device has their own test code base
Compile and Installation
●   Configuration

    # Makefile / Place in the root of code base
    KDIR:=$(PWD)/../kernel/android-3.0
    CROSS_COMPILE:=arm-none-linux-gnueabi-
    HOST:=x86_64




●    Compile

    # Compile for g-sensor
    $ make TESTSUITES=accelerometer


    # For all devices
    $ make
    # A "build" folder will be created
Compile and Installation
●   Install to device

    # In OMAP DDT folder
    $ adb push build /system/testsuites


    # /system/testsuites is recommended
Compile and Installation
●   Install to device

    # In OMAP DDT folder
    $ adb push build /system/testsuites


    # /system/testsuites is recommended




                        gh to
                      ou !!
                   En ST
               Not    TE
                 R un
Pre-requirement
●   Pre-requirement
    ○   Busybox
    ○   Bash

●   Repository location
    ○   git://busybox.net/busybox.git
    ○   git://git.savannah.gnu.org/bash.git

●   Homepage
    ○   http://www.busybox.net/
    ○   http://savannah.gnu.org/projects/bash
Pre-requirement
   ●    Configuration for Busybox

Busybox Settings --> Build Options --> Build Busybox as a static binary (no shared libs)
 - Enable this option by pressing "Y"
Busybox Settings --> Build Options --> Cross compiler prefix
 - Set this option equal to "arm-none-linux-gnueabi-"
Busybox Settings --> General Configuration --> Don't use /usr
 - Enable this option by pressing "Y"
Linux Module Utilities --> [ ] Simplified modutils
                 [*] insmod
                 [*] rmmod
                 [*] lsmod
                 [*] Pretty output
                 [ ] modprobe
                 [ ] depmod
Linux Module Utilities --> [ ] Support version 2.2/2.4 Linux kernels
Linux Module Utilities --> [ ] Try to load module from a mmap'ed area
Linux Module Utilities --> [*] Support tainted module checking with new kernels
Linux Module Utilities --> () Default directory containing modules - Set this option to nothing
Linux Module Utilities --> () Default name of modules.dep - Set this option to nothing
Pre-requirement
●   Install Busybox

    $ adb push busybox /system/sbin
    $ adb shell


    $ cd /system/sbin
    $ ./busybox --install .


    # /system/sbin is recommended
Pre-requirement
●    Install Busybox

     $ adb push busybox /system/sbin
     $ adb shell


     $ cd /system/sbin
     $ ./busybox --install .


     # /system/sbin is recommended




    Don't forget the DOT
Pre-requirement
●   Compile Bash

    $ CC=arm-none-linux-gnueabi-gcc ./configure --prefix=/opt/arm_bash/
        --host=arm-linux --enable-static-link --without-bash-malloc
    $
    $ make



●   Install Bash

    $ adb push bash /system/sbin
    $ adb shell


    $ cd /system/sbin
    $ mv sh sh.busybox
    $ ln -s /system/sbin/bash sh
Run Test
●   Run all test under device
    # In /system/testsuites/accelerometer/test_code/script/
    $ ./run_all.sh


●   Troubleshooting
     ○    tmp - cannot work as a temporary directory
     ○    test - cannot work as a test directory
    # In /system/testsuites/accelerometer/test_code/script/
    $ mkdir tmp test

     ○    /bin/sh: bad interpreter: No such file or directory
    # !/bin/sh
    Modify to ...
    # !/system/sbin/sh
Run Test
Run Test




 蝦毀
    !!
Automation Tool
●   TITAN, TI   Test AutomatioN tool
    ○   Control board through serial or telnet connection
    ○   Scheduling to run the test cases.
    ○   Auto boot support (Phidget board required)

●   Repository location
    ○   git://dev.omapzoom.org/pub/scm/cristopherson/titan-development.git

●   Last commit
Automation Tool
●   Recommended Environment
    ○   Netbeans
    ○   Java 1.6

●   Project dependency
    ○   Titan_Common
        ■   commons-net-1.4.1.jar
        ■   iText-2.1.0.jar
        ■   RXTXcomm.jar
        ■   ganymed-ssh2-build210.jar
        ■   poi-3.6-20091214.jar
Automation Tool
●   Project dependency
    ○   Titan_DevelopmentBoard
        ■   Phidget21.jar

    ○   Titan_GUI
        ■   jcalendar.jar
        ■   RXTXcomm.jar
        ■   Phidget21.jar
        ■   iText-2.1.0.jar
        ■   poi-3.6-20091214.jar
Automation Tool
●   Screenshot
Automation Tool
●   Choose connection
Automation Tool
●   Choose connection
Automation Tool
●   Connection setting
Automation Tool
●   Set test provider
Automation Tool
●   Set test provider
Automation Tool
●   Set test provider
Automation Tool
●   Tests loaded
Automation Tool
●   Check test cases
Automation Tool
●   Schedule test
Run Test
Customization
●   Test code organization




                             main configuration file

                                run all tests

                                      test runner
Customization
      ●   Default device configuration in conf.sh
          ○   BMA180

...
if [ `cat $SYSFS_BOARD_REV | grep -c "Tablet"` -ge 1 ]; then
      # Specific to bma180 sensor
      export ACCELEROMETER_SYSFS_PATH="/sys/bus/i2c/drivers/bma180_accel/4-0040"
      export ACCELEROMETER_HW="bma180"
      export ACCELEROMETER_POWERON_VAL=1
      export ACCELEROMETER_POWEROFF_VAL=0
      export ACCELEROMETER_ENABLE_POWER="$ACCELEROMETER_SYSFS_PATH/enable"
...
Customization
      ●   Add my device configuration to conf.sh
          ○   BMA250E

...
elif [ `cat $SYSFS_BOARD_REV | grep -c "Panda"` -ge 1 ]; then
      # Specific to bma250e sensor
      export ACCELEROMETER_SYSFS_PATH="/sys/devices/accelerometer"
      export ACCELEROMETER_HW="bma250e"
      export ACCELEROMETER_POWERON_VAL=1
      export ACCELEROMETER_POWEROFF_VAL=0
      export ACCELEROMETER_ENABLE_POWER="$ACCELEROMETER_SYSFS_PATH/enable"
      # Some extra configurations
...
Customization
●    run_all.sh

    #! /system/sbin/sh


    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0001
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0002
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0003
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0004
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0005   Scenarios
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0006
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0007
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0008
    ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0011
    ...
Customization
●   Test code structure




                          Shell scripts




                                 C code
Customization
●   Test code structure
                 Ctrl
                      +   C an
                                 d Ct
                                     rl +
                                            V
                            C code
Customization
●   Scenarios
      ○      L_DD_ACCELEROMETER_0000_0002

    #####################################################################
    # Scenario: L_DD_ACCELEROMETER_0000_0002
    # Author : Hemanth V
    # Date    : Thu Jun 24 16:43:42 IST 2010
    #####################################################################
    # Begin L_DD_ACCELEROMETER_0000_0002


    # FILE exists and is a symbolic link (same as -L)
    01 set -x; test -h $ACCELEROMETER_SYSFS_PATH


    # End L_DD_ACCELEROMETER_0000_0002
Customization
●   Scenarios with helper
     ○        L_DD_ACCELEROMETER_0000_0005
    ...
    01 $ACCELEROMETER_DIR_HELPER/$ACCELEROMETER_HW/ACC_0000_0005
    ...



          ○   ACC_0000_0005

    echo -n "1" > $ACCELEROMETER_SYSFS_PATH/enable
    echo "Ensure board is Flat on the surfacen"
    value=`$ACCELEROMETER_DIR_BINARIES/acctest $DEVFS_ACCELEROMETER Z
              | grep Value | awk '{print $2}'`


    [ $value -ge 900 ]
Customization
●   Add scenarios
     ○     L_DD_ACCELEROMETER_0000_0099
    ...
    01 $ACCELEROMETER_DIR_HELPER/$ACCELEROMETER_HW/ACC_0000_0099
    ...



     ○     run_all.sh
    #! /system/sbin/sh
    ....
    /test_runner.sh -S L_DD_ACCELEROMETER_0000_0099
    ...
Customization
●   ACC_0000_0099
    # Test the enable/disable function of accelerometer
    handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWERON_VAL


    handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWERON_VAL || exit 1


    handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWEROFF_VAL


    handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWEROFF_VAL || exit 100


    exit 0
Customization
●   Run it!
     ○     L_DD_ACCELEROMETER_0000_0099
    # In /system/testsuites/accelerometer/test_code/script/
    $ ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0099


    # Or
    $ ./run_all.sh
Customization
●   Run by Titan
     ○ omap-ddt/automation/test_descriptors/accelerometer/teststitan-
         testdescriptor.xml

    <test id="L_DD_ACCELEROMETER_0000_0001">
                <information>
                      <autor>Jiahe Jou</autor>
                      <description>Test enable/disable feature of accelerometer.</description>
                      <dateofcreation>21/11/2012</dateofcreation>
                </information>
                <run>
                      <action>
                            <command>/testsuites/accelerometer/scripts/test_runner.sh
    L_DD_ACCELEROMETER_0000_0099</command>
                      </action>
                      <action>
                            <command>rm /testsuites/accelerometer/scripts/log.*</command>
                      </action>
                </run>
Customization
●   Run by Titan
     ○ omap-ddt/automation/test_descriptors/accelerometer/teststitan-
        testdescriptor.xml

             <pass>
                  <output>
                        <value>stat=0</value>
                  </output>
             </pass>

             <fail>
                    <timeout time="15"/>
                    <output>
                          <regularexpression>stat=[^0]d*</regularexpression>
                    </output>
             </fail>

        </test>
Utilities
●   Under "omap-ddt/utils/*"
●   PAN tool
    ○   A test driver integrated from LTP
    ○   Execute listed test cases, report 0 for all passed, or number of failed
    ○   Ex. scenarios

●   akey
     ○ Listen KEY_ENTER, KEY_SELECT and KEY_OK from kaypad

●   waitkey
     ○ Listen any one key event

●   BC tool
    ○   For "bc programming language" for math
    ○   Syntax is similar to C
Utilities
●   evtest
    ○   Event listener, exit by interrupt

●   handlers
    ○   A collection of useful helpers, such as operating on sysfs
    ○   handlerActivityManager.sh
    ○   handlerAndroidMonkey.sh
    ○   handlerAndroidPM.sh
    ○   handlerAndroidSqlite3.sh
    ○   handlerCpuFreqScalFrequencies.sh
    ○   handlerSysFs.sh
    ○   ...
    ○   About 4x helpers
Utilities
●   memtester tool
    ○   Memoey testing tool

●   microcom tool
    ○   Minicom-like serial terminal emulator

●   priority
    ○   Get and set processes' priority

●   schedutils tool
    ○   Control processes's scheduling
Utilities
●   scripts
    ○   A collection of useful scripts and monkey scripts
    ○   android_display_switch.sh
    ○   is_android_ready.sh
    ○   display.live.wallpaper.menu
    ○   display.system.wallpaper.menu
    ○   ics.set.max.screen.timeout.value
    ○   t2.ics.unlock.screen
    ○   ...
    ○   About 2x scripts
Utilities
●   Usage
    # Test the enable/disable function of accelerometer
    handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWERON_VAL


    handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWERON_VAL || exit 1


    handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWEROFF_VAL


    handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable
    $ACCELEROMETER_POWEROFF_VAL || exit 100


    exit 0
Utilities
●   Usage
    #####################################################################
    # Scenario: L_DD_ACCELEROMETER_0000_0005
    # Author : Hemanth V
    # Date    : Thu Jun 24 16:43:42 IST 2010
    #####################################################################
    # Begin L_DD_ACCELEROMETER_0000_0005


    echo -n "1" > $ACCELEROMETER_SYSFS_PATH/enable
    echo "Ensure board is Flat on the surfacen"
    value=`$ACCELEROMETER_DIR_BINARIES/acctest $DEVFS_ACCELEROMETER Z
             | grep Value | awk '{print $2}'`


    [ $value -ge 900 ]
Q&A
End

More Related Content

What's hot

Kernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementKernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementAnne Nicolas
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisBuland Singh
 
Crash Dump Analysis 101
Crash Dump Analysis 101Crash Dump Analysis 101
Crash Dump Analysis 101John Howard
 
Linux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshopLinux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshopLubomir Rintel
 
Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)yang firo
 
Kernel Recipes 2013 - Kernel for your device
Kernel Recipes 2013 - Kernel for your deviceKernel Recipes 2013 - Kernel for your device
Kernel Recipes 2013 - Kernel for your deviceAnne Nicolas
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker containerVinay Jindal
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootKenny (netman)
 
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...PROIDEA
 
Manage custom kernel builds
Manage custom kernel buildsManage custom kernel builds
Manage custom kernel buildsMarian Marinov
 
Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingKenny (netman)
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugginglibfetion
 
Ищем уязвимости нулевого дня в ядре Linux
Ищем уязвимости нулевого дня в ядре LinuxИщем уязвимости нулевого дня в ядре Linux
Ищем уязвимости нулевого дня в ядре LinuxPositive Hack Days
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyAnne Nicolas
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellKenny (netman)
 
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Anne Nicolas
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Anne Nicolas
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014Jian-Hong Pan
 

What's hot (20)

Kernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementKernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power Management
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
 
Kernel crashdump
Kernel crashdumpKernel crashdump
Kernel crashdump
 
Chap 19 web
Chap 19 webChap 19 web
Chap 19 web
 
Crash Dump Analysis 101
Crash Dump Analysis 101Crash Dump Analysis 101
Crash Dump Analysis 101
 
Linux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshopLinux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshop
 
Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)
 
Kernel Recipes 2013 - Kernel for your device
Kernel Recipes 2013 - Kernel for your deviceKernel Recipes 2013 - Kernel for your device
Kernel Recipes 2013 - Kernel for your device
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker container
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
 
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
 
Manage custom kernel builds
Manage custom kernel buildsManage custom kernel builds
Manage custom kernel builds
 
Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation reading
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Ищем уязвимости нулевого дня в ядре Linux
Ищем уязвимости нулевого дня в ядре LinuxИщем уязвимости нулевого дня в ядре Linux
Ищем уязвимости нулевого дня в ядре Linux
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easy
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
 
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014
 

Viewers also liked

Viewers also liked (20)

Unit Test Android Without Going Bald
Unit Test Android Without Going BaldUnit Test Android Without Going Bald
Unit Test Android Without Going Bald
 
Continuous Integration for BSP
Continuous Integration for BSPContinuous Integration for BSP
Continuous Integration for BSP
 
20分で理解するdisplaysystem
20分で理解するdisplaysystem20分で理解するdisplaysystem
20分で理解するdisplaysystem
 
Arro capabilities lean revised 2010
Arro capabilities   lean revised 2010Arro capabilities   lean revised 2010
Arro capabilities lean revised 2010
 
Internet Week Yahoo! Academy: How Direct Can You Be?
Internet Week Yahoo! Academy: How Direct Can You Be?Internet Week Yahoo! Academy: How Direct Can You Be?
Internet Week Yahoo! Academy: How Direct Can You Be?
 
The perng mha ngan box
The perng mha ngan boxThe perng mha ngan box
The perng mha ngan box
 
The perng mha ngan box
The perng mha ngan boxThe perng mha ngan box
The perng mha ngan box
 
Algorithm Final Presentation
Algorithm Final PresentationAlgorithm Final Presentation
Algorithm Final Presentation
 
General Catalog GFS Indonesia
General Catalog GFS IndonesiaGeneral Catalog GFS Indonesia
General Catalog GFS Indonesia
 
Nokia n9 ug_ru
Nokia n9 ug_ruNokia n9 ug_ru
Nokia n9 ug_ru
 
Integrate gitolite with mantis
Integrate gitolite with mantisIntegrate gitolite with mantis
Integrate gitolite with mantis
 
Nicholas John Spykman
Nicholas John SpykmanNicholas John Spykman
Nicholas John Spykman
 
видеокамера сони
видеокамера сонивидеокамера сони
видеокамера сони
 
Reading
ReadingReading
Reading
 
Bosh
BoshBosh
Bosh
 
FA Catalog
FA CatalogFA Catalog
FA Catalog
 
Luat thue thu nhap ca nhan 2007
Luat thue thu nhap ca nhan 2007Luat thue thu nhap ca nhan 2007
Luat thue thu nhap ca nhan 2007
 
Gallus2002 usermanual
Gallus2002 usermanualGallus2002 usermanual
Gallus2002 usermanual
 
Gresco catalog
Gresco catalogGresco catalog
Gresco catalog
 
пдд азербайджана
пдд азербайджанапдд азербайджана
пдд азербайджана
 

Similar to Introduction of unit test on android kernel

Fuzzing softwares for bugs - OWASP Seasides
Fuzzing softwares for bugs - OWASP SeasidesFuzzing softwares for bugs - OWASP Seasides
Fuzzing softwares for bugs - OWASP SeasidesOWASPSeasides
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment Systema3sec
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptxssuserb4d806
 
Designate Install and Operate Workshop
Designate Install and Operate WorkshopDesignate Install and Operate Workshop
Designate Install and Operate WorkshopGraham Hayes
 
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling ToolsTIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling ToolsXiaozhe Wang
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLinaro
 
EuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsEuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsVinícius Zavam
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudAndrea Righi
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerApplitools
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Tomáš Čorej: Configuration management & CFEngine3
Tomáš Čorej: Configuration management & CFEngine3Tomáš Čorej: Configuration management & CFEngine3
Tomáš Čorej: Configuration management & CFEngine3Jano Suchal
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideLinaro
 
SECON'2017, Цаль-Цалко Иван, Go на практике
SECON'2017, Цаль-Цалко Иван, Go на практикеSECON'2017, Цаль-Цалко Иван, Go на практике
SECON'2017, Цаль-Цалко Иван, Go на практикеSECON
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
First steps with Gazebo simulation for ROS
First steps with Gazebo simulation for ROSFirst steps with Gazebo simulation for ROS
First steps with Gazebo simulation for ROSSergey Matyunin
 

Similar to Introduction of unit test on android kernel (20)

Fuzzing softwares for bugs - OWASP Seasides
Fuzzing softwares for bugs - OWASP SeasidesFuzzing softwares for bugs - OWASP Seasides
Fuzzing softwares for bugs - OWASP Seasides
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Designate Install and Operate Workshop
Designate Install and Operate WorkshopDesignate Install and Operate Workshop
Designate Install and Operate Workshop
 
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling ToolsTIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android N
 
Introduction to clarity
Introduction to clarityIntroduction to clarity
Introduction to clarity
 
EuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsEuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD Systems
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test Runner
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Tomáš Čorej: Configuration management & CFEngine3
Tomáš Čorej: Configuration management & CFEngine3Tomáš Čorej: Configuration management & CFEngine3
Tomáš Čorej: Configuration management & CFEngine3
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
 
SECON'2017, Цаль-Цалко Иван, Go на практике
SECON'2017, Цаль-Цалко Иван, Go на практикеSECON'2017, Цаль-Цалко Иван, Go на практике
SECON'2017, Цаль-Цалко Иван, Go на практике
 
Intro django
Intro djangoIntro django
Intro django
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
First steps with Gazebo simulation for ROS
First steps with Gazebo simulation for ROSFirst steps with Gazebo simulation for ROS
First steps with Gazebo simulation for ROS
 
Android - ADB
Android - ADBAndroid - ADB
Android - ADB
 

Recently uploaded

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Introduction of unit test on android kernel

  • 1. Introduction of Unit Test on Android Kernel Jiahe Jou, 2012/11/22
  • 2. Revisions DATE AUTHOR DESCRIPTION 2012/11/13 Jiahe Jou Draft.
  • 3. Outlines ● OMAP DDT Overview ● Compile and Installation ● Pre-requirement ● Run Test ● Automation Tool ● Customization ● Utilities
  • 4. OMAP DDT Overview ● OMAP DDT(Device Driver Test) ○ Device driver testing framework for OMAP Linux kernel ○ Part of Linux OMAP Project ● Repository location ○ Old: git://dev.omapzoom.org/pub/scm/richo/device_driver_test.git ○ New: git://gitorious.org/omap-ddt/omap-ddt.git ● Current branches ○ master ○ ddt-2.6.35 ○ ddt-2.6.39 ○ ddt-3.0
  • 5. OMAP DDT Overview ● First commit
  • 6. OMAP DDT Overview ● Current owner ● Committer ○ Leed Aguilar, leedsalim@gmail.com ○ Dmytro Kedrovskyi, x0158318@ti.com ○ Mariia Nagul, x0171643@ti.com
  • 7. OMAP DDT Overview ● Every device has their own test code base
  • 8. Compile and Installation ● Configuration # Makefile / Place in the root of code base KDIR:=$(PWD)/../kernel/android-3.0 CROSS_COMPILE:=arm-none-linux-gnueabi- HOST:=x86_64 ● Compile # Compile for g-sensor $ make TESTSUITES=accelerometer # For all devices $ make # A "build" folder will be created
  • 9. Compile and Installation ● Install to device # In OMAP DDT folder $ adb push build /system/testsuites # /system/testsuites is recommended
  • 10. Compile and Installation ● Install to device # In OMAP DDT folder $ adb push build /system/testsuites # /system/testsuites is recommended gh to ou !! En ST Not TE R un
  • 11. Pre-requirement ● Pre-requirement ○ Busybox ○ Bash ● Repository location ○ git://busybox.net/busybox.git ○ git://git.savannah.gnu.org/bash.git ● Homepage ○ http://www.busybox.net/ ○ http://savannah.gnu.org/projects/bash
  • 12. Pre-requirement ● Configuration for Busybox Busybox Settings --> Build Options --> Build Busybox as a static binary (no shared libs) - Enable this option by pressing "Y" Busybox Settings --> Build Options --> Cross compiler prefix - Set this option equal to "arm-none-linux-gnueabi-" Busybox Settings --> General Configuration --> Don't use /usr - Enable this option by pressing "Y" Linux Module Utilities --> [ ] Simplified modutils [*] insmod [*] rmmod [*] lsmod [*] Pretty output [ ] modprobe [ ] depmod Linux Module Utilities --> [ ] Support version 2.2/2.4 Linux kernels Linux Module Utilities --> [ ] Try to load module from a mmap'ed area Linux Module Utilities --> [*] Support tainted module checking with new kernels Linux Module Utilities --> () Default directory containing modules - Set this option to nothing Linux Module Utilities --> () Default name of modules.dep - Set this option to nothing
  • 13. Pre-requirement ● Install Busybox $ adb push busybox /system/sbin $ adb shell $ cd /system/sbin $ ./busybox --install . # /system/sbin is recommended
  • 14. Pre-requirement ● Install Busybox $ adb push busybox /system/sbin $ adb shell $ cd /system/sbin $ ./busybox --install . # /system/sbin is recommended Don't forget the DOT
  • 15. Pre-requirement ● Compile Bash $ CC=arm-none-linux-gnueabi-gcc ./configure --prefix=/opt/arm_bash/ --host=arm-linux --enable-static-link --without-bash-malloc $ $ make ● Install Bash $ adb push bash /system/sbin $ adb shell $ cd /system/sbin $ mv sh sh.busybox $ ln -s /system/sbin/bash sh
  • 16. Run Test ● Run all test under device # In /system/testsuites/accelerometer/test_code/script/ $ ./run_all.sh ● Troubleshooting ○ tmp - cannot work as a temporary directory ○ test - cannot work as a test directory # In /system/testsuites/accelerometer/test_code/script/ $ mkdir tmp test ○ /bin/sh: bad interpreter: No such file or directory # !/bin/sh Modify to ... # !/system/sbin/sh
  • 19. Automation Tool ● TITAN, TI Test AutomatioN tool ○ Control board through serial or telnet connection ○ Scheduling to run the test cases. ○ Auto boot support (Phidget board required) ● Repository location ○ git://dev.omapzoom.org/pub/scm/cristopherson/titan-development.git ● Last commit
  • 20. Automation Tool ● Recommended Environment ○ Netbeans ○ Java 1.6 ● Project dependency ○ Titan_Common ■ commons-net-1.4.1.jar ■ iText-2.1.0.jar ■ RXTXcomm.jar ■ ganymed-ssh2-build210.jar ■ poi-3.6-20091214.jar
  • 21. Automation Tool ● Project dependency ○ Titan_DevelopmentBoard ■ Phidget21.jar ○ Titan_GUI ■ jcalendar.jar ■ RXTXcomm.jar ■ Phidget21.jar ■ iText-2.1.0.jar ■ poi-3.6-20091214.jar
  • 22. Automation Tool ● Screenshot
  • 23. Automation Tool ● Choose connection
  • 24. Automation Tool ● Choose connection
  • 25. Automation Tool ● Connection setting
  • 26. Automation Tool ● Set test provider
  • 27. Automation Tool ● Set test provider
  • 28. Automation Tool ● Set test provider
  • 29. Automation Tool ● Tests loaded
  • 30. Automation Tool ● Check test cases
  • 31. Automation Tool ● Schedule test
  • 33. Customization ● Test code organization main configuration file run all tests test runner
  • 34. Customization ● Default device configuration in conf.sh ○ BMA180 ... if [ `cat $SYSFS_BOARD_REV | grep -c "Tablet"` -ge 1 ]; then # Specific to bma180 sensor export ACCELEROMETER_SYSFS_PATH="/sys/bus/i2c/drivers/bma180_accel/4-0040" export ACCELEROMETER_HW="bma180" export ACCELEROMETER_POWERON_VAL=1 export ACCELEROMETER_POWEROFF_VAL=0 export ACCELEROMETER_ENABLE_POWER="$ACCELEROMETER_SYSFS_PATH/enable" ...
  • 35. Customization ● Add my device configuration to conf.sh ○ BMA250E ... elif [ `cat $SYSFS_BOARD_REV | grep -c "Panda"` -ge 1 ]; then # Specific to bma250e sensor export ACCELEROMETER_SYSFS_PATH="/sys/devices/accelerometer" export ACCELEROMETER_HW="bma250e" export ACCELEROMETER_POWERON_VAL=1 export ACCELEROMETER_POWEROFF_VAL=0 export ACCELEROMETER_ENABLE_POWER="$ACCELEROMETER_SYSFS_PATH/enable" # Some extra configurations ...
  • 36. Customization ● run_all.sh #! /system/sbin/sh ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0001 ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0002 ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0003 ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0004 ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0005 Scenarios ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0006 ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0007 ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0008 ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0011 ...
  • 37. Customization ● Test code structure Shell scripts C code
  • 38. Customization ● Test code structure Ctrl + C an d Ct rl + V C code
  • 39. Customization ● Scenarios ○ L_DD_ACCELEROMETER_0000_0002 ##################################################################### # Scenario: L_DD_ACCELEROMETER_0000_0002 # Author : Hemanth V # Date : Thu Jun 24 16:43:42 IST 2010 ##################################################################### # Begin L_DD_ACCELEROMETER_0000_0002 # FILE exists and is a symbolic link (same as -L) 01 set -x; test -h $ACCELEROMETER_SYSFS_PATH # End L_DD_ACCELEROMETER_0000_0002
  • 40. Customization ● Scenarios with helper ○ L_DD_ACCELEROMETER_0000_0005 ... 01 $ACCELEROMETER_DIR_HELPER/$ACCELEROMETER_HW/ACC_0000_0005 ... ○ ACC_0000_0005 echo -n "1" > $ACCELEROMETER_SYSFS_PATH/enable echo "Ensure board is Flat on the surfacen" value=`$ACCELEROMETER_DIR_BINARIES/acctest $DEVFS_ACCELEROMETER Z | grep Value | awk '{print $2}'` [ $value -ge 900 ]
  • 41. Customization ● Add scenarios ○ L_DD_ACCELEROMETER_0000_0099 ... 01 $ACCELEROMETER_DIR_HELPER/$ACCELEROMETER_HW/ACC_0000_0099 ... ○ run_all.sh #! /system/sbin/sh .... /test_runner.sh -S L_DD_ACCELEROMETER_0000_0099 ...
  • 42. Customization ● ACC_0000_0099 # Test the enable/disable function of accelerometer handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWERON_VAL handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWERON_VAL || exit 1 handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWEROFF_VAL handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWEROFF_VAL || exit 100 exit 0
  • 43. Customization ● Run it! ○ L_DD_ACCELEROMETER_0000_0099 # In /system/testsuites/accelerometer/test_code/script/ $ ./test_runner.sh -S L_DD_ACCELEROMETER_0000_0099 # Or $ ./run_all.sh
  • 44. Customization ● Run by Titan ○ omap-ddt/automation/test_descriptors/accelerometer/teststitan- testdescriptor.xml <test id="L_DD_ACCELEROMETER_0000_0001"> <information> <autor>Jiahe Jou</autor> <description>Test enable/disable feature of accelerometer.</description> <dateofcreation>21/11/2012</dateofcreation> </information> <run> <action> <command>/testsuites/accelerometer/scripts/test_runner.sh L_DD_ACCELEROMETER_0000_0099</command> </action> <action> <command>rm /testsuites/accelerometer/scripts/log.*</command> </action> </run>
  • 45. Customization ● Run by Titan ○ omap-ddt/automation/test_descriptors/accelerometer/teststitan- testdescriptor.xml <pass> <output> <value>stat=0</value> </output> </pass> <fail> <timeout time="15"/> <output> <regularexpression>stat=[^0]d*</regularexpression> </output> </fail> </test>
  • 46. Utilities ● Under "omap-ddt/utils/*" ● PAN tool ○ A test driver integrated from LTP ○ Execute listed test cases, report 0 for all passed, or number of failed ○ Ex. scenarios ● akey ○ Listen KEY_ENTER, KEY_SELECT and KEY_OK from kaypad ● waitkey ○ Listen any one key event ● BC tool ○ For "bc programming language" for math ○ Syntax is similar to C
  • 47. Utilities ● evtest ○ Event listener, exit by interrupt ● handlers ○ A collection of useful helpers, such as operating on sysfs ○ handlerActivityManager.sh ○ handlerAndroidMonkey.sh ○ handlerAndroidPM.sh ○ handlerAndroidSqlite3.sh ○ handlerCpuFreqScalFrequencies.sh ○ handlerSysFs.sh ○ ... ○ About 4x helpers
  • 48. Utilities ● memtester tool ○ Memoey testing tool ● microcom tool ○ Minicom-like serial terminal emulator ● priority ○ Get and set processes' priority ● schedutils tool ○ Control processes's scheduling
  • 49. Utilities ● scripts ○ A collection of useful scripts and monkey scripts ○ android_display_switch.sh ○ is_android_ready.sh ○ display.live.wallpaper.menu ○ display.system.wallpaper.menu ○ ics.set.max.screen.timeout.value ○ t2.ics.unlock.screen ○ ... ○ About 2x scripts
  • 50. Utilities ● Usage # Test the enable/disable function of accelerometer handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWERON_VAL handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWERON_VAL || exit 1 handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWEROFF_VAL handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable $ACCELEROMETER_POWEROFF_VAL || exit 100 exit 0
  • 51. Utilities ● Usage ##################################################################### # Scenario: L_DD_ACCELEROMETER_0000_0005 # Author : Hemanth V # Date : Thu Jun 24 16:43:42 IST 2010 ##################################################################### # Begin L_DD_ACCELEROMETER_0000_0005 echo -n "1" > $ACCELEROMETER_SYSFS_PATH/enable echo "Ensure board is Flat on the surfacen" value=`$ACCELEROMETER_DIR_BINARIES/acctest $DEVFS_ACCELEROMETER Z | grep Value | awk '{print $2}'` [ $value -ge 900 ]
  • 52. Q&A
  • 53. End