Meego Wiki
Views

Quality/TestSuite/Input Devices Driver Test Specification

From MeeGo wiki
< Quality | TestSuite
Revision as of 13:08, 14 December 2010 by Kimmyl (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

The blts-input-devices (0.0.2) test driver is intended for testing input devices using kernel's input subsystem. The input subsystem basically exposes the raw input events to userspace through a collection of character device nodes — one character device node per logical input device.

Test Coverage

Test cases are:

  • Input - Enumerate devices: Queries information (version, capabilities, name etc.) from all the input devices defined in configuration file.
  • Input - Single touch: The test case expects user to touch 4 quadrants of the screen, one at a time. Position and received events are verified.
  • Input - Multi-touch: The test case expects user to touch 2 quadrants of the screen simultaneously. Position and received events are verified.

Software Coverage

Current coverage for tests:

Hardware Coverage

Hardware coverage includes mainly touchscreen. Enumerate devices -test case can be used to verify existence and basic functionality of any input device.

Running the tests

Hardware setup and test environment

The test environment must have following packages installed:

  • libbltscommon1
  • libX11

Building packages

The input devices test package comes with a packaging script that can be used to build tarball out of the sources, RPM package or Debian package. To build RPM package, in the root directory execute command:

./pack.sh -r

To get packaging script help, execute command:

./pack.sh -h

The building environment requires the following RPM packages installed:

  • libbltscommon-devel
  • libX11-devel
  • kernel-headers

Configuration package

The blts-input-devices-tests package is dependent on blts-input-devices-tests-config configuration file package. The packaging script pack.sh creates RPM package blts-input-devices-tests-config-example_{version}.rpm and it must be installed first. The configuration file /etc/blts/blts-input-devices-tests.cnf is copied in the test device during RPM installation.

The configuration file package can be installed in the device by executing the command:

rpm -ivh blts-input-devices-tests-config-example_{version}.rpm

Test asset specific instructions

The test package can be installed in the device by executing the command:

rpm -ivh blts-input-devices-tests_{version}.rpm 

Test case arguments

Arguments:

General Switch Function
-l Used log file
-e Execute single or multiple selected tests, for example -e 1,4,5.
-en Execute test by name, for example -en "My test X"
-s Show list of all tests
-C Used configuration file
-? Help message
-xml, -axml Create result XML. -axml appends results to an existing XML file.
-auto Silent logging for test automation. Only the results are printed to stdout.
-v Verbose logging (default)
-vv Even more verbose logging
Optional Switch Function
-g Do not grab the devices exclusively
-d Debug specific device. This is for development purposes.

Test cases must be run with root privileges.

Test cases

Test case execution notices:

Case name Notice
Input - Enumerate devices
Input - Single touch
Input - Multi-touch


Test case descriptions and execution commands:

  • Input - Enumerate devices
* Checks existence of input devices, and queries information from them.
* $ blts-input-devices-tests -en "Input - Enumerate devices"
  • Input - Single touch
* Touchscreen test with single touch point. The test case expects user to touch 4 quadrants of the screen, one at a time.
* $ blts-input-devices-tests -en "Input - Single touch"
  • Input - Multi-touch
* Touchscreen test with 2 (or more) touch points. The test case expects user to touch 2 quadrants of the screen simultaneously.
* $ blts-input-devices-tests -en "Input - Multi-touch"

Configuration file examples

To run test case with variable data you need to specify where configuration file is located or if no configuration file is given, test driver tries to use default /etc/blts/blts-input-devices-tests.cnf

To run "Input - Enumerate devices" case you can use: blts-input-devices-tests -l /var/log/tests/Enumerate_devices.log -en "Input - Enumerate devices" -C blts-input-devices-tests.cnf

Input devices are platform specific. Modify the configuration file with correct input devices and settings if needed.

# Input devices to test (currently used only by Enumerate devices -test case)
# Give either an absolute path (for example "/dev/input/event1"), or just
# name of the device node (for example, "event1").
[parameter]
	name input_devices
	const "event1 event3 event4"
[end_parameter]

# Used pointer device (currently only touchscreen devices are supported, for
# example mice will not work)
[parameter]
	name pointer_device
	const "event4"
[end_parameter]

# Screen orientation; 0 = TS and screen coordinate system is the same,
# 1 = swap X and Y axis
[parameter]
	name scr_orientation
	const 0
[end_parameter]

# Screen size in pixels
[parameter]
	name scr_size
	const "864x480"
[end_parameter]

Module Design and Architecture

The test module can be compiled to self-sufficient command line program. Both Debian and RPM packaging is also provided.

Architecture diagram

References

Linux kernel Kernel sources
blts-input-devices blts-input-devices tests


Change History

Version Date Handled By Status Comments
0.1 10-Dec-2010 Aki Nyman Draft Page created (refers to blts-input-devices test package 0.0.2)
Personal tools