This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP 4460 Kernel device driver testing

Hi

I am trying to test device driver on panda board having android(ICS)  kernel.i have followed link http://www.omappedia.com/wiki/OMAP_Kernel_driver_tests

but I am getting error like

adb shell   
#cd test/gpio/scripts
1|root@android:/data/gpio/scripts # sh test_runner.sh L_DD_GPIO_0000_0001      #trying to test one of test scenario of i2c as per give procedure in wiki link
test_runner.sh[305]: dirname: not found
FATAL: FATAL: Testsuite configuration file not found
test_runner.sh[305]: can't create temporary file /sqlite_stmt_journals/mksh.KJLkpgG847: No such file or directory
INFO: Cleaning up...INFO: Clean up process won't be executed because variables for directories to be removed are not set...
done.

so with this i try to find out where is problem

#!/bin/sh
#-----------------------
# Based on runltp script from LTP
# Much of the functions are copied over from there
# Copyright remains
#-----------------------

# Global configuration file
TS_CONF="../../utils/configuration/general.configuration"     here is problem

# Give standard error message and die
die()
{
    echo "FATAL: $*"
    usage
    exit 1
}

# Give information message
info()
{
    echo "INFO: $*"
}

# Give debug message

debug_a()
{
    echo "DEBUG: $*"
}

# Comment out and suit urself..Debug help
alias debug=/bin/true
# alias debug=debug_a

# Defaults and sanity stuff
setup()
{

    cd `dirname $0` || \
    {
        die "unable to change directory to $(dirname $0)"
    }

    # Load config file
    if [ -f "$TS_CONF" ]; then
        . $TS_CONF
        if [ $? -eq 0 ]; then
            echo "INFO: General configuration completed"
        else
            echo "FATAL: General configuration file with errors"
        fi
    else
        die "FATAL: Testsuite configuration file not found"
    fi

    # scenario less tests?? have the user organize it properly at least..
    [ -d $TC_SCENARIO ] ||
    {
        die "Test suite not installed correctly - no scenarios"
    }

    # we'd need the reporting tool ofcourse..
    [ -e $UTILS_DIR_BIN/pan ] ||
    {
        die "FATAL: Test suite driver 'pan' not found"
    }
}

usage()
{
    # Human redable please
    local PP=` if [ -z "$PRETTY_PRT" ]; then echo "off"; else echo "on"; fi`
    local VV=` if [ -z "$VERBOSE" ]; then echo "off"; else echo "on"; fi`

    # Give the gyan
    cat <<-EOF >&2
    usage: ./${0##*/} [-z] [-h] [-v] [-d TESTDIR] [-o OUTPUTFILE] [-l LOGFILE]
    [-n DURATION ] [-t TMPDIR] [SCENARIO_NAMES..]

    -d TESTDIR      Run LTP to test the filesystem mounted here. [Current - $TESTDIR]
            At the end of test, the testdir gets cleaned out
    -s TC_SCENARIO  Test scenarios are located here. [Current - $TC_SCENARIO]
    -o OUTPUTFILE   Redirect test output to a file. [Current- $OUTPUTFILE {psid}]
    -p              Human readable(dont laugh too much) format logfiles. [Current - ($PP)]
    -z              Dont Merge the Scenario Name with tcid to create final tc id
    -E              Use Extended Test cases also - these are painful and can take real long time
    -l LOGFILE      Log results of test in a logfile. [Current- $LOGFILE {psid}]
    -t TMPDIR       Run LTP using tmp dir [Current - $TMPBASE]
    -n DURATION     Execute the testsuite for given duration. Examples:
            -n 60s = 60 seconds
            -n 45m = 45 minutes
            -n 24h = 24 hours
            -n 2d  = 2 days
            [Current - $DURATION]

    -v              Print more verbose output to screen.[Current - ($VV)]
    -q              No messages from this script. no info too - Brave eh??
    -h              This screen [Current - guess...]
    -x INSTANCES    Run multiple instances of this testsuite.(think well...)
    -r PRE_DEF      Run predefined set of scenarios[Not Implemented yet]
            List to appear here
    -S              Run in Stress mode

    SCENARIO_NAMES  List of scenarios to test.. else, take all scenarios
            [Current - These are all filenames from $TC_SCENARIO]

    Good News: Ctrl+c stops and cleans up for you :)
    More help: Read the $TESTROOT/README

    EOF
    exit 0
}

# Insane world.. insane set of human mistakes!!
sanity_check()
{
    # Check the current values...
    # Just ensure that pan can run with a bit of peace of mind...

    [ ! -d "$TMPBASE" -o ! -w "$TMPBASE" ] && die "$TMPBASE - cannot work as temporary directory"
    [ ! -d "$TESTDIR" -o ! -w "$TESTDIR" ] && die "$TESTDIR - cannot work as test directory"
    [ ! -d "$TC_SCENARIO" ] && die "$TC_SCENARIO - No such directories"
    [ -z "$SCENARIO_NAMES" ] && die "No Scenarios"
        [ ! -z "$VERBOSE" -a ! -z "$QUIET_MODE" ] && die "Make up your mind - verbose or quiet??"

    export CMDFILE=$TMPBASE/$CMDFILE
    rm -f $CMDFILE

        for SCEN in $SCENARIO_NAMES
    do
          [ ! -f "$TC_SCENARIO/$SCEN" -o ! -r "$TC_SCENARIO/$SCEN" ] && die "$TC_SCENARIO/$SCEN - not a scenario file"
            cat $TC_SCENARIO/$SCEN|grep -v "#"|sed -e "s/^[  ]*$//g"|sed -e "/^$/d">$TMPFILE|| die "Count not create tmp file $TMPFILE"
            if [ -z "$DONT" ]; then
                cat $TMPFILE|sed -e "s/^/$SCEN-/g"|sed -e "s/-/_/" >>$CMDFILE || die "Count not create command file $CMDFILE"
                else
                cat $TMPFILE>>$CMDFILE || die "Count not create command file $CMDFILE"
            fi

            # Remove the extended test cases
            if [ -z "$EXTENDED_TEST" ]; then

                cat $CMDFILE|grep -v "^[_A-Za-z0-9]*_EXT ">$TMPFILE || die "intermediate file gen failed"
                cat $TMPFILE>$CMDFILE || die "Second intermediate creation failed"
            fi

            rm -f $TMPFILE

    done

        local PP=` if [ -z "$PRETTY_PRT" ]; then echo "off"; else echo "on"; fi`
    local VV=` if [ -z "$VERBOSE" ]; then echo "off"; else echo "on"; fi`
    export TMPDIR=${TESTDIR}

        # Print some nice info
    if [ ! -z "$VERBOSE" ]; then
        debug "POSTFIX        $POSTFIX       "
        info  "TESTROOT       $TESTROOT      "
        info  "TMPBASE        $TMPBASE       "
        info  "TMPFILE        $TMPFILE       "
        debug "CMDFILE        $CMDFILE       "
        info  "TESTDIR        $TESTDIR       "
        info  "PRETTY_PRT     $PP            "
        info  "VERBOSE        $VV            "
        info  "OUTPUTFILE     $OUTPUTFILE    "
        info  "LOGFILE        $LOGFILE       "
        info  "DURATION       $DURATION      "
        debug "PATH           $PATH          "
        info  "TC_SCENARIO    $TC_SCENARIO   "
        info  "TMPDIR         $TMPDIR        "
        info  "SCENARIO_NAMES $SCENARIO_NAMES"
    fi
}

main()
{
    count=0
    while getopts zx:Sd:qt:po:l:vn:hs:E:I arg
    do  case $arg in
        d)
            TESTDIR=${OPTARG} ;;
        t)
            TMPBASE=${OPTARG} ;;
        E)
            EXTENDED_TEST=y ;;
            q)
            QUIET_MODE=" -q " ;;
            z)
            DONT=" " ;;
        p)
            PRETTY_PRT=" -p " ;;
        o)
            OUTPUTFILE=${OPTARG};OO_LOG=1 ;;
        l)
            LOGFILE=${OPTARG} ;;
        v)
            VERBOSE="-v" ;;
        n)
            DURATION=" -t ${OPTARG}" ;;
        h)
            usage ;;
        x)  # number of ltp's to run

            cat <<-EOF >&1
            WARNING: The use of -x can cause unpredictable failures, as a
            result of concurrently running multiple tests designed
            to be ran exclusively.
            Pausing for 10 seconds...Last chance to hit that ctrl+c
            EOF
                    sleep 10
            INSTANCES="-x $OPTARG -O ${TMP}" ;;
        s)
            TC_SCENARIO=${OPTARG} ;;
        S)
            STRESS=y
            STRESSARG="-S";;

        \?) # Handle illegals
            usage ;;

    esac

    if [ ! -z "${OPTARG}" ]; then
        count=" $count + 2"
    else
        count=" $count + 1"
    fi

    done

    count=$(( $count ))
    while [ $count -ne 0 ]
    do
        shift;
        count=$(($count - 1))
    done

    SCENARIO_NAMES=$@

    sanity_check

    # Test start

    [ -z "$QUIET_MODE" ] && { info "Test start time: $(date)" ; }
    # run pan
    # $PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output
    #Usage: pan -n name [ -SyAehp ] [ -s starts ] [-t time[s|m|h|d] [ -x nactive ] [
    #-l logfile ]
    #[ -a active-file ] [ -f command-file ] [ -d debug-level ]
    #[-o output-file] [-O output-buffer-directory] [cmd]

    cd $TESTDIR
    PAN_COMMAND="${UTILS_DIR_BIN}/pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ -n $$ $PRETTY_PRT -f ${CMDFILE} -l $LOGFILE"

    [ ! -z "$VERBOSE" ] && { info "PAN_COMMAND=$PAN_COMMAND"; }

    if [ -z "$OO_LOG" ]; then
        $PAN_COMMAND
    else
        $PAN_COMMAND|tee $OUTPUTFILE
    fi

    if [ $? -eq 0 ]; then
        echo "INFO: pan reported all tests PASS"
        VALUE=0
    else
        echo "INFO: pan reported some tests FAIL"
        VALUE=1
    fi

    # Test end
    [ -z "$QUIET_MODE" ] && { info "Test end time: $(date)" ; }
    [ -z "$QUIET_MODE" ] && {

    cat <<-EOF >&1

    ###############################################################"
        Done executing testcases."
        Result log is in the $LOGFILE "
    ###############################################################"

    EOF
    cat $LOGFILE

    }
    cleanup
    exit $VALUE
}


cleanup()
{
    [  -z "$QUIET_MODE" ] && echo -n "INFO: Cleaning up..."
    if [ -n "${TMPFILE}" -a -n "${CMDFILE}" -a -n "${TESTDIR}" -a -n "${TMPBASE}" ]; then
        rm -rf ${TMPFILE} ${CMDFILE} ${TESTDIR}/* ${TMPBASE}/*
    else
        echo "INFO: Clean up process won't be executed because variables for directories to be removed are not set..."
    fi

    [  -z "$QUIET_MODE" ] && echo "done."
}


trap "cleanup" 0
setup
main "$@"

# End of file


so please help me out how i am solve this.

 as i try to install busy box on panda board still getting an error

thanks in advance

  • Hi

    now i have installed busy box properly and i run the test

    i get error like below

    /testroot/gpio/scripts # ./test_runner.sh L_DD_GPIO_0010_0001
    INFO: Syfs configuration completed              #
    INFO: Handlers configuration completed     #   this part was error now due to busy-box instillation .it is solved
    INFO: General configuration completed       #
    FATAL: /testroot/gpio/scripts/tmp - cannot work as temporary directory     # this is error now

    usage: ./test_runner.sh [-z] [-h] [-v] [-d TESTDIR] [-o OUTPUTFILE] [-l LOGFILE]
    [-n DURATION ] [-t TMPDIR] [SCENARIO_NAMES..]

    -d TESTDIR      Run LTP to test the filesystem mounted here. [Current - /testroot/gpio/scripts/test]
    At the end of test, the testdir gets cleaned out
    -s TC_SCENARIO  Test scenarios are located here. [Current - /testroot/gpio/scripts/scenarios]
    -o OUTPUTFILE   Redirect test output to a file. [Current- /testroot/gpio/scripts/tmp/output.20121229-103757 {psid}]
    -p              Human readable(dont laugh too much) format logfiles. [Current - (off)]
    -z              Dont Merge the Scenario Name with tcid to create final tc id
    -E              Use Extended Test cases also - these are painful and can take real long time
    -l LOGFILE      Log results of test in a logfile. [Current- /testroot/gpio/scripts/tmp/log.20121229-103757 {psid}]
    -t TMPDIR       Run LTP using tmp dir [Current - /testroot/gpio/scripts/tmp]
    -n DURATION     Execute the testsuite for given duration. Examples:
    -n 60s = 60 seconds
    -n 45m = 45 minutes
    -n 24h = 24 hours
    -n 2d  = 2 days
    [Current - ]

    -v              Print more verbose output to screen.[Current - (off)]
    -q              No messages from this script. no info too - Brave eh??
    -h              This screen [Current - guess...]
    -x INSTANCES    Run multiple instances of this testsuite.(think well...)
    -r PRE_DEF      Run predefined set of scenarios[Not Implemented yet]
    List to appear here
    -S              Run in Stress mode

    SCENARIO_NAMES  List of scenarios to test.. else, take all scenarios
    [Current - These are all filenames from /testroot/gpio/scripts/scenarios]

    Good News: Ctrl+c stops and cleans up for you :)
    More help: Read the /testroot/gpio/scripts/README

    INFO: Cleaning up...done.
    /testroot/gpio/scripts #

    so please someone help me out to  off this problem.

  • Can you provide some data about your actual development base? are you using ICS? is it 4AI.1.7 release? to try to reproduce the issue.

    by the error it seems that tmp directory is pointing a root directory, try to change it to inside of /mnt/sdcard/ or /data/ and/or using root user.

  • @Manuel Contreras

    thanks for ur response

    I am using 4AI.1.4 release and ,for above error this i have created two folder namely "test" and "tmp" and i get the output .now i have one problem is that i am unable to make busy box shell as default shell due to that i am getting shell related error like script file we run by using sh  and making file executable and use "./filename"  .so  in DDT they used second way and according me now Device driver  test cases is perfect problem is in busy box  installation.

    for busy box installation i follow omappedia  but i am unable to make busybox shell default shell.

    so i am trying to solve this problem.

    regards

    madhav

  • @Manuel Contreras

    this is the info  when i run test_runner script

    uid=0 gid=0@android:/ # cd data/testroot/gpio/                             #   
    uid=0 gid=0@android:/data/testroot/gpio # ls scripts/                   #                     
    uid=0 gid=0@android:/data/testroot/gpio # ls                                 #   this is to test gpio driver
    modules  scripts                                                                                    #
    uid=0 gid=0@android:/data/testroot/gpio # cd scripts/                   #       
    uid=0 gid=0@android:/data/testroot/gpio/scripts # ls scenarios/  #              
    L_DD_GPIO_0000_0001  L_DD_GPIO_0005_0001  L_DD_GPIO_0010_0001 
    L_DD_GPIO_0001_0001  L_DD_GPIO_0006_0001  L_DD_GPIO_0011_0001
    L_DD_GPIO_0001_0002  L_DD_GPIO_0007_0001  L_DD_GPIO_0012_0001
    L_DD_GPIO_0002_0001  L_DD_GPIO_0007_0002  L_DD_GPIO_0013_0001
    L_DD_GPIO_0003_0001  L_DD_GPIO_0007_0003  L_DD_GPIO_0014_0001
    L_DD_GPIO_0004_0001  L_DD_GPIO_0008_0001  L_DD_GPIO_0014_0002
    L_DD_GPIO_0004_0002  L_DD_GPIO_0009_0001  L_DD_GPIO_0014_0003
    test_runner.sh L_DD_GPIO_0005_0001                                            < # selected one of above scenarios
    INFO: Syfs configuration completed
    INFO: Handlers configuration completed
    ./test_runner.sh: ../../utils/configuration/general.configuration: line 211: handlerError.sh: not found # error1
    FATAL: General configuration file with errors
    FATAL: /data/testroot/gpio/scripts/tmp - cannot work as temporary directory                                           # error2
    usage: ./test_runner.sh [-z] [-h] [-v] [-d TESTDIR] [-o OUTPUTFILE] [-l LOGFILE]
    [-n DURATION ] [-t TMPDIR] [SCENARIO_NAMES..]

    -d TESTDIR      Run LTP to test the filesystem mounted here. [Current - /data/testroot/gpio/scripts/test]
    At the end of test, the testdir gets cleaned out
    -s TC_SCENARIO  Test scenarios are located here. [Current - /data/testroot/gpio/scripts/scenarios]
    -o OUTPUTFILE   Redirect test output to a file. [Current- /data/testroot/gpio/scripts/tmp/output.20000101-020412 {psid}]
    -p              Human readable(dont laugh too much) format logfiles. [Current - (off)]
    -z              Dont Merge the Scenario Name with tcid to create final tc id
    -E              Use Extended Test cases also - these are painful and can take real long time
    -l LOGFILE      Log results of test in a logfile. [Current- /data/testroot/gpio/scripts/tmp/log.20000101-020412 {psid}]
    -t TMPDIR       Run LTP using tmp dir [Current - /data/testroot/gpio/scripts/tmp]
    -n DURATION     Execute the testsuite for given duration. Examples:
    -n 60s = 60 seconds
    -n 45m = 45 minutes
    -n 24h = 24 hours
    -n 2d  = 2 days
    [Current - ]

    -v              Print more verbose output to screen.[Current - (off)]
    -q              No messages from this script. no info too - Brave eh??
    -h              This screen [Current - guess...]
    -x INSTANCES    Run multiple instances of this testsuite.(think well...)
    -r PRE_DEF      Run predefined set of scenarios[Not Implemented yet]
    List to appear here
    -S              Run in Stress mode

    SCENARIO_NAMES  List of scenarios to test.. else, take all scenarios
    [Current - These are all filenames from /data/testroot/gpio/scripts/scenarios]

    Good News: Ctrl+c stops and cleans up for you :)
    More help: Read the /data/testroot/gpio/scripts/README

    INFO: Cleaning up...done.
    uid=0 gid=0@android:/data/testroot/gpio/scripts # mkdir tmp  # solution for error 2
    uid=0 gid=0@android:/data/testroot/gpio/scripts # mkdir test   #               
    GPIO_0005_0001                                                                <
    INFO: Syfs configuration completed
    INFO: Handlers configuration completed
    ./test_runner.sh: ../../utils/configuration/general.configuration: line 211: handlerError.sh: not found  #error 1
    FATAL: General configuration file with errors  # due to error1
    INFO: Test start time: Sat Jan  1 02:04:28 UTC 2000
    + <<<test_start>>>
    tag=L_DD_GPIO_0005_0001_0001 stime=946692268
    cmdline=" set -x; handlerGpioTest.sh "run" 4"
    contacts=""
    analysis=exit
    initiation_status="ok"
    <<<test_output>>>
    incrementing stop
    handlerGpioTest.sh run 4
    sh: handlerGpioTest.sh: not found #error2
    <<<execution_status>>>
    duration=0 termination_type=exited termination_id=127 corefile=no
    cutime=0 cstime=0
    <<<test_end>>>
    INFO: pan reported some tests FAIL
    INFO: Test end time: Sat Jan  1 02:04:28 UTC 2000

    ###############################################################"
    Done executing testcases."
    Result log is in the /data/testroot/gpio/scripts/tmp/log.20000101-020428 "
    ###############################################################"

    startup='Sat Jan  1 02:04:28 2000'
    tag=L_DD_GPIO_0005_0001_0001 stime=946692268 dur=0 exit=exited stat=127 core=no cu=0 cs=0
    INFO: Cleaning up...done.
    INFO: Cleaning up...done.

    so  now according to me problem  is in shell that  i am unable to make busybox shell as default shell or may be ( i am not sure)in the configuration file

    when i cross check this test DDT on my pc .it run perfectly and gave msg  that this not right hardware platform.so that’s why i tried to installed busybox on ICS android kernel  on panda board .

    so  please help me to figure out from this problem

    regards

    madhav

  • Inside the scripts .sh files the first line indicates the location of sh command, it should be pointing to the location of sh inside /system/bin/.

  • http://omappedia.org/wiki/Android_Installing_Busybox_Command_Line_Tools

    i followed above link to install busy box

    Installing Busybox at run-time

    pc> ./adb shell target
    $ cd /system/busybox
     target$ ./busybox --install . target
    $ ./sh
    # here i am getting error as "./sh: precmd: not found"


    Make the Busybox shell the default shell

    target$ cd /system/bin target$ mv sh sh.android target$ ln -s /system/busybox/sh sh

    for "it should be pointing to the location of sh inside /system/bin/." for that only i am making busy box shell as default shell
    and Eport the path as below instead of adding in init.rc file 

    export PATH=$PATH: /system/busybox:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin

    if i am wrong please correct me

    Regards

    madhav











  • There is a third variable to modify, for bash scripts the first row indicates the interpreter or shell to use.

    For /omap-ddt/gpio/test_code/scripts there are 2 files ended with .s, 

    /omap-ddt/gpio/test_codtest_runner.sh 

    /omap-ddt/gpio/test_code/scripts/helper/handlerGpioTest.sh

  • @Manuel Contrera

    According to  you i have changed #!/bin/bash to #!/system/bin/sh

    it works.still there are some  error.

    /testroot/gpio/scripts # ./test_runner.sh L_DD_GPIO_0005_0001
    INFO: Syfs configuration completed
    INFO: Handlers configuration completed
    INFO: General configuration completed
    INFO: Test start time: Wed Jan  9 07:04:22 UTC 2013
    <<<test_start>>>
    tag=L_DD_GPIO_0005_0001_0001 stime=1357715062
    cmdline=" set -x; handlerGpioTest.sh "run" 4"
    contacts=""
    analysis=exit
    initiation_status="ok"
    <<<test_output>>>
    incrementing stop
    + handlerGpioTest.sh run 4
    sh: handlerGpioTest.sh: Permission denied #error 1 even  changed permission to excutable
    <<<execution_status>>>
    duration=0 termination_type=exited termination_id=126 corefile=no
    cutime=0 cstime=0
    <<<test_end>>>
    INFO: pan reported some tests FAIL
    INFO: Test end time: Wed Jan  9 07:04:22 UTC 2013

    ###############################################################"
    Done executing testcases."
    Result log is in the /testroot/gpio/scripts/tmp/log.20130109-070422 "
    ###############################################################"

    startup='Wed Jan  9 07:04:22 2013'
    tag=L_DD_GPIO_0005_0001_0001 stime=1357715062 dur=0 exit=exited stat=126 core=no cu=0 cs=0
    INFO: Cleaning up...done.
    INFO: Cleaning up...done.



  • Sorry for late response, I still need to try to reproduce the issue to see what is happening.

    I think you changed #!/system/bin/sh inside handlerGpioTest.sh too, there could be a restriction in Android about calling scripts inside a script, not sure, or the way that this script is called.

    Are you using root user?

  • problem is in utils/handlers/ handlersGpio.sh file is not present ,so it may be compilation error of omap-ddt.

    and i try to recompile it but everytime there is no such file in utils/handlers/

    I think by default In Adb work as root user.

  • There is similar file

    /omap-ddt/gpio/test_code/scripts/helper/handlerGpioTest.sh

    and contents matches it, try renaming it instead of correcting all files.

  • Thanks  Manuel.

    for  L_DD_GPIO_0001_0001

    data/testroot/gpio/scripts # ./test_runner.sh L_DD_GPIO_0001_0001

    insmod: can't insert '/data/testroot/gpio/scripts/../modules/gpio_test.ko': invalid module format #error

    now i am getting this error for above gpio scenario

    till now i have tested only gpio.

    now moving to other driver test suits

    but for above error means my compilation of omap-ddt  is not perfect or there is another problem

    and  insmod is present in system/bin/

  • finally successful omap-ddt completed .I have followed below instruction for busybox  installtion which solve all my problem.

    pc $ mount -o remount -rw /

    pc$adb push busybox /sbin/

    pc$adb push bash /sbin/

    pc$ adb shell

    device #cd sbin/

    device#chmod 777 *

    device#./busybox --install .

    device#chmod 777 *

    device # cd ..

    device# ln -s /system/bin/ /bin

    Thanks  to  Manuel.

    Regards

    madhav