m (→Configuration package) |
|||
| (2 intermediate revisions not shown) | |||
| Line 54: | Line 54: | ||
The test environment must have following packages installed: | The test environment must have following packages installed: | ||
| - | ;*libbltscommon1 | + | ;*[[../BLTS Common Library | libbltscommon1]] |
===Building packages=== | ===Building packages=== | ||
| - | The | + | The build environment must have the following packages installed: |
| - | + | ;*[[../BLTS Common Library | libbltscommon-devel]] | |
| - | ./ | + | ;* kernel-devel |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | {{:Quality/TestSuite/Building_BLTS_Packages}} | |
| - | + | ||
| - | + | ||
=== Configuration package === | === Configuration package === | ||
| Line 94: | Line 85: | ||
NOTE: Supported endpoint configurations differ from device to device and they should be modified according to test execution requirements. These configuration files are provided as examples and should not be used as such during proper test execution. | NOTE: Supported endpoint configurations differ from device to device and they should be modified according to test execution requirements. These configuration files are provided as examples and should not be used as such during proper test execution. | ||
| - | For further instructions on creating and using configuration files, see [ | + | For further instructions on creating and using configuration files, see [[Quality/TestSuite/USB_Driver_Test_Specification#Configuration_file_examples|Configuration file examples]]. |
===Test asset specific instructions=== | ===Test asset specific instructions=== | ||
Contents |
blts-usb package (0.0.14) is test driver using USB host and peripheral devices.
USB peripheral test cases are made between host (e.g. PC) and peripheral gadget (e.g. N900). Both ends have their own drivers which communicate and transfer data between different endpoints.
Each test case must be run independently and devices must be preset according to case requirements using provided setup test cases. In practice, this means for example data transfer requires preconnected host enabled USB cable and host mode supporting device is connected to system. Each test case prints out required user interaction to terminal.
Current coverage for USB tests:
Configurable USB endpoint transfer test cases.
Required hardware:
How to setup test environment:
NOTE: Before executing test cases it must be determined if used devices are capable of acting as peripheral or host. This depends on USB controller chips of devices and necessary information should be available from device vendors.
To run test cases, execute the command:
$ blts_usb_testrunner -C [config file] -e [test number]
The test environment must have following packages installed:
The build environment must have the following packages installed:
The source package includes the pack.sh script, which is used for building RPM and Debian packages and source tar packages. To build an RPM package with the script, execute this command in the top level source directory of asset:
./pack.sh -r
To get help about the packaging script, execute
./pack.sh -h
The asset can also be built manually by executing:
./autogen.sh ./configure make
The blts-usb package is dependent on blts-usb-tests-config configuration file package. The packaging script pack.sh creates RPM package blts-usb-tests-config-example_{version}.rpm and it must be installed first. The configuration files are copied in the test device during RPM installation.
The configuration file package can be installed in the device with a command:
rpm -ivh blts-usb-tests-config-example_{version}.rpm
This test asset uses two configuration files: One for generic test execution options and one for endpoint configuration. Endpoint configuration file is linked to base configuration files thus only base file path is given as parameter. Configuration files must be used, as they contain endpoint configuration for driver.
Currently following example base configuration file is included in the package:
The base files are linked to endpoint configuration files and following example is provided with test package:
NOTE: Supported endpoint configurations differ from device to device and they should be modified according to test execution requirements. These configuration files are provided as examples and should not be used as such during proper test execution.
For further instructions on creating and using configuration files, see Configuration file examples.
The test package can be installed in the device by executing the command:
rpm -ivh blts-usb-tests_{version}.rpm
Common test execution guidelines
NOTE:
NOTE: All other gadget drivers MUST be unloaded before test execution in used DUT!
You can use command lsmod to determine which modules are loaded in memory:
$ lsmod
See if some gadget driver is found. For example g_file_storage is a mass storage module, but this depends on used HW and SW. The module can be unloaded with following command:
$ modprobe -r g_file_storage
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 |
|---|---|
| -h | Use given host driver (default: blts_usb_host), for example -h blts_usb_host |
| -p | Use given peripheral driver (default: blts_gadget), for example -h blts_gadget |
Test case execution notices:
| Case name | Notice |
|---|---|
| USB - Setup host driver* | |
| USB - Setup peripheral driver# | Use configuration file to create specific setup, bulk endpoints are created by default |
| USB - Read test* | Read data from endpoints |
| USB - Write test* | Write data to endpoints |
* This test is run on host device.
# This test is run on peripheral device.
Test case descriptions and execution commands:
$ blts-usb-tests -en "USB - Setup host driver"
$ blts-usb-tests -en "USB - Setup peripheral driver"
$ blts-usb-tests -en "USB - Read test"
$ blts-usb-tests -en "USB - Write test"
The test asset allows you to change all endpoint parameters via configuration files. Since the USB (2.0) specification only states the valid range for different settings, it is possible to give any values as long as they fit inside these ranges. The test asset allows experimenting with different configurations and "triangulation" of what works and what does not. Naturally there are certain HW related restrictions such as total transfer capacity which obviously cannot be exceeded with endpoint configuration. Basic test asset configurations is done with base configuration files, such as provided blts-usb-testrunner-default.cnf:
# USB test case configuration for parameters ###################### # General parameters # ###################### [parameter] name host_driver const "blts_usb_host" [end_parameter] [parameter] name host_driver_path const "/usr/lib/tests/blts-usb-tests/" [end_parameter] [parameter] name peripheral_driver const "blts_gadget" [end_parameter] [parameter] name peripheral_driver_path const "/usr/lib/tests/blts-usb-tests/" [end_parameter] [parameter] name data_transfer_timeout const "10000" [end_parameter] [parameter] name usb_transfer_size const 4096 [end_parameter] ########################## # Endpoint configuration # ########################## [parameter] name ep_configuration_file const "/etc/blts/ep-configuration-default.cfg" [end_parameter] ################ # Driver setup # ################ [test] name "USB - Setup host driver" params host_driver host_driver_path [end_test] [test] name "USB - Setup peripheral driver" params peripheral_driver peripheral_driver_path usb_transfer_size ep_configuration_file [end_test] ####################### # Data transfer cases # ####################### [test] name "USB - Read test" params host_driver host_driver_path peripheral_driver peripheral_driver_path usb_transfer_size [end_test] [test] name "USB - Write test" params host_driver host_driver_path peripheral_driver peripheral_driver_path usb_transfer_size [end_test]
To change the endpoint configuration, you will have to edit ep-configuration files. For example, provided ep-configuration-default.cfg looks like this by default:
# device_speed used_speed max_power high any 50 # endpoint type direction max_packet_size interval 1 bulk in 512 9 2 bulk out 512 9
The lines starting with # are comments and document provided parameters. Device_speed is the highest speed used device is supposed to be able handle (any/low/full/high) and used_speed the operational speed during test execution. This can be used to force the device to use lower speed than normally would be used. To add new pair of bulk endpoints simply add following lines to the file:
3 bulk in 512 9 4 bulk out 512 9
Do note that you can put different endpoint types to the same configuration so there can be any combination of bulk, interrupt and isochronous endpoints as long as device supports this.
Both Debian and RPM package is provided. The package includes both host and peripheral drivers in addition to test runner. This package can be installed on all devices under testing, although functionality depends on used hardware.
| USB Specification | USB documentation |
| blts-usb | blts-usb tests |
| Version | Date | Handled By | Status | Comments |
|---|---|---|---|---|
| 0.1 | 8-sep-2010 | Iekku Huttunen | Draft | Page created |
| 0.2 | 15-Dec-2010 | Aki Nyman | Draft | Page updated to refer blts usb test package 0.0.14 |