OMAP Kernel driver tests
This is the device driver test (DDT) page, part of the Linux OMAP Project.
This page provides a general overview of the test and test automation tools used for the OMAP Linux Kernel software development.
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
New repository: omap-ddt
DDT cloning information
New repository at gitorious.org
git clone git://gitorious.org/omap-ddt/omap-ddt.git
- 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.
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 <driver>/test_code/scripts/scenarios/
- The support modules and scripts exist in <driver>test_code/utils and the utils directory at the top level
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> Driver_x=The driver for which the testsuite is to be built Use "all" for building the entire testsuite * Export TESTROOT=<output dir><output dir>
- 'make' is used to build the testcode
* cd omap-ddt/ * make
- On successful compilation, the output is stored in <device_driver_test>/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.
Target Filesystem setup
1. Download Busybox and Bash from DailyBuild
<daily build path>/extras/busybox.tar.bz2 <daily build path>/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
7. Create symlinks for scripts executions
mount -o remount rw / ln -s /data/busybox/bin /bin ln -s /data/busybox/sbin /sbin
- 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/
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_<driver>_<tc_id>_<seq_num>. For example, the first DMA test case is L_DD_DMA_0001_0001
- In order to execute a scenario, navigate to <driver>/test_code/scripts and type ./test_runner.sh <scenario id>
- The test module provides a PASS or FAIL output
- Logs are stored as <timestamp>.log on the same folder
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
- See USB_Testing for extra information on USB specific test setup
- Packages needed for compilation in UBUNTU
sudo apt-get install flex textinfo