OMAP Kernel driver tests
From OMAPpedia
This is the device driver test (DDT) page, part of the Linux OMAP Project.
Contents |
[edit] Introduction
This page provides a general overview of the test and test automation tools used for the OMAP Linux Kernel software development.
[edit] Device driver test code
Test cases for OMAP specific device drivers are written and maintained in a separate git tree.
Old repository: device_driver_test[1]
New repository: omap-ddt[2]
[edit] DDT cloning information
New repository at gitorious.org
git clone git://gitorious.org/omap-ddt/omap-ddt.git
Branches:
- master device driver test support for upstream Kernel
- ddt-2.6.35 device driver test support for Kernel 2.6.35 and below
- ddt-2.6.39 device driver test support for Kernel 2.6.39
- ddt-3.0 device driver test support for Kernel 3.0
master branch is the main development tree and others branches are meant to support specific Kernel revisions. Changes or patches applicable across the branches will be cherry-pick from master branch.
[edit] Structure of device driver test code
- The device_driver_test repository is organised into a series of folders for testing each driver (ex: GPIO, UART)
- Each folder has a collection of bash scripts, kernel modules and user space utilities as needed to test the driver.
- Each testcase is numbered, and exists in
/test_code/scripts/scenarios/ - The support modules and scripts exist in
test_code/utils and the utils directory at the top level
[edit] Compiling the test code
- Because of kernel module dependencies, the kernel to be tested has to be configured and built first before building the test code.
- The following variables are needed for the testsuite build system. They should be either exported to the environment before starting 'make' or passed as parameters to make.
* Export CROSS_COMPILE=arm-none-linux-gnueabi- * Export KDIR=[PATH-TO-KERNEL] * Export HOST=arm-none-linux-gnueabi * Export TESTSUITES=Driver_x=The driver for which the testsuite is to be built Use "all" for building the entire testsuite * Export TESTROOT=
- 'make' is used to build the testcode
* cd omap-ddt/ * make
- On successful compilation, the output is stored in
/build directory. This is expected to be copied to the target filesystem on OMAP, conventionally as /testsuites - See the readme file at the top level device_driver_test for more details.
Note: Code Sourcery Toolchain is required for compilation. Successfully tested with 2010q1-202 version.
Note: Please install gengetopt "sudo apt-get install gengetopt" or remove audio-alsa from TESTSUITES in .config file.
[edit] Target Filesystem setup
ANDROID USERS:
1. Download Busybox and Bash from DailyBuild
/extras/busybox.tar.bz2 /extras/bash.tar.bz2
2. Untar both packages in your HOST machine
tar -xjvf busybox.tar.bz2 tar -xjvf bash.tar.bz2
3. Copy Bash binary into busybox/bin/ 4. Flash busybox into /data partition of target filesystem 5. Verify that busybox tools have executable permissions
chmod 777 /data/busybox/bin/* chmod 777 /data/busybox/sbin/*
6. Add Busybox to the global PATH variable
PATH:/data/busybox/bin:/data/busybox/sbin:$PATH
7. Create symlinks for scripts executions
mount -o remount rw / ln -s /data/busybox/bin /bin ln -s /data/busybox/sbin /sbin
Troubleshooting:
- rmmod not working
Delete /data/busybox/bin/rmmod to use the default Android rmmod tool under /system/bin/
- reboot not working
Delete /data/busybox/bin/reboot to use the default Android reboot tool under /system/bin/
[edit] Executing test cases
- The testcases are executed using the PAN module, similar to the one used in Linux test project http://ltp.sourceforge.net/ . This has already been bundled into the utils folder at the top level
- Each testcase is called as a scenario, and usually numbered as L_DD_
_ _ . For example, the first DMA test case is L_DD_DMA_0001_0001 - In order to execute a scenario, navigate to
/test_code/scripts and type ./test_runner.sh - The test module provides a PASS or FAIL output
- Logs are stored as
.log on the same folder
[edit] Automated tests using TITAN
Titan is a java based test automation tool. It is used in conjunction with OMAP device driver tests to execute the tests repeatedly and automatically. Visit Titan_Test_Automation page for more information
[edit] Additional Notes
- See USB_Testing for extra information on USB specific test setup
- Packages needed for compilation in UBUNTU
sudo apt-get install flex textinfo