(Created page with "== Introduction == nl80211 is the 802.11 netlink interface and cfg80211 is the linux wireless configuration API. nl80211 is used to configure a cfg80211 device and together the…") |
|||
| Line 262: | Line 262: | ||
To run "Core-WLAN-Associate with WEP encryption" case for example, execute the command: | To run "Core-WLAN-Associate with WEP encryption" case for example, execute the command: | ||
| - | <code>blts-wlan-core -l /var/log/tests/Core-WLAN-Associate_with_WEP_encryption.log -en "Core-WLAN-Associate with WEP encryption" -C /etc/blts/blts-wlan-core-tests.cnf</code> | + | <code>blts-wlan-core-tests -l /var/log/tests/Core-WLAN-Associate_with_WEP_encryption.log -en "Core-WLAN-Associate with WEP encryption" -C /etc/blts/blts-wlan-core-tests.cnf</code> |
Example of WEP encryption case variation: | Example of WEP encryption case variation: | ||
Contents |
nl80211 is the 802.11 netlink interface and cfg80211 is the linux wireless configuration API.
nl80211 is used to configure a cfg80211 device and together they are intended to replace Wireless-Extensions in the future.
blts-wlan-core package (0.1.3) is testing nl80211 commands and also some Wireless-Extensions ioctls and events but only when corresponding nl80211 implementations are not available.
Current BLTS WLAN test coverage matrix:
Linux wireless cards/drivers that support nl80211/cfg80211 (and Wireless Extensions).
Future test cases may include further tests for nl80211 commands which are not covered yet.
Required hardware for testing over the air:
Multiple access points with different static configurations can be used instead of changing the AP configuration directly. The access point used must support DHCP discovery, either by itself or via a suitable network arrangement. SSIDs, keys and passphrases used must be entered in the test configuration file.
The adhoc tests "Establish new adhoc network" and "Join established adhoc network" are counterparts and require two adhoc mode capable test devices, both running the test case.
The test environment must have following packages installed:
Setting up software simulator - mac80211_hwsim
If there is no suitable HW available for test execution or there is a need for verifying test case functionality, it is also possible to run some test cases with mac80211_hwsim.
mac80211_hwsim is a software simulator of 802.11 radios for mac80211. It is a Linux kernel module that can be used to simulate arbitrary number of IEEE 802.11 radios for mac80211.
The following steps are needed to use mac80211_hwsim to simulate radios and run test cases
1) build mac80211_hwsim as part of kernel configuration
2) load the kernel module (parameter 'radios' can be used to select how many radios are simulated - default 2)
$ modprobe mac80211_hwsim
Read further instruction about mac80211_hwsim usage from mac80211_hwsim web page (http://wireless.kernel.org/en/users/Drivers/mac80211_hwsim)
To simulate AP where the other station can associate to, the hostapd daemon (http://w1.fi/hostapd/) with a proper configuration file can be used
$ hostapd hostapd.conf
The wlan-core 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:
The wlan-core-tests package is dependent on blts-wlan-core-tests-config configuration file package. The packaging script pach.sh creates RPM package blts-wlan-core-tests-config-example_{version}.rpm and it must be installed first. The configuration file /etc/blts/blts-wlan-core-tests.cnf is copied in the test device during RPM installation.
The configuration file package can be installed in the device with a command: blts-wlan-core-tests-config-example_{version}.rpm
The test package can be installed in the device with a command:
rpm -ivh blts-wlan-core-tests_{version}.rpm
Test case execution instructions:
The Enumerate hardware and Enumerate supported features tests run on a single device and do not require any existing access points. Enumerate hardware case can be configured to search expected phys (e.g. phy0) from the test device.
The configuration file used must be modified to match the test environment. SSIDs, keys and passphrases used must be entered in the test configuration file before testing.
Disconnect with AP loss test case waits about 60 seconds after connection is established that tester will turn off the AP where connection is made. The test case shows tester a text "Turn off AP to pass this test" and will only continue if AP is turned off, otherwise timeout occurs and test case fails.
Test cases using established adhoc network are counter parts and these test cases must be executed at the same time with two devices, so that the establishing side must be executed first and the joining side soon after that. The name and used channel for established adhoc network can be configured in the configuration file. The SSID used here must be unique (no networks with a same name in the test environment) otherwise these tests fail.
Arguments:
| Switch | Function |
|---|---|
| -l | Used log file, Used log file, default blts_wlan_core_log.txt |
| -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 and path, for example /etc/blts/blts-wlan-core-tests.cnf |
| -? | 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 |
| -p | Enables profiling of ioctl calls |
| -v | Verbose logging |
| -S | (Power)Save mode on |
| --nltrace | Print out raw Netlink commands as they are issued |
Test cases execution must be done with root privileges.
Test case execution notices:
| Case name | Notice |
|---|---|
| Core-WLAN-Enumerate hardware | |
| Core-WLAN-Enumerate supported features | |
| Core-WLAN-Scan for specific AP | |
| Core-WLAN-Associate with open AP | |
| Core-WLAN-Associate with WEP encryption | |
| Core-WLAN-Scan and associate on max power save | overrides command line parameter -S (power save) |
| Core-WLAN-Associate with WPA2-PSK AP | |
| Core-WLAN-Disconnect with deauthenticate | |
| Core-WLAN-Disconnect with disassociate | |
| Core-WLAN-Disconnect with AP loss | Turn off AP manually when "Turn off AP to pass this test" is printed |
| Core-WLAN-Disconnect from adhoc network | requires existing open adhoc network where to connect |
| Core-WLAN-Establish new adhoc network | |
| Core-WLAN-Join established adhoc network | remote must be running establish new adhoc network test case |
Test case descriptions and execution commands:
$ blts-wlan-core-tests -en "Core-WLAN-Enumerate hardware"
$ blts-wlan-core-tests -en "<code>$ blts-wlan-core-tests -en "Core-WLAN-Enumerate hardware""</code>
$ blts-wlan-core-tests -en "Core-WLAN-Scan for specific AP"
$ blts-wlan-core-tests -en "Core-WLAN-Associate with open AP"
$ blts-wlan-core-tests -en "Core-WLAN-Associate with WEP encryption"
$ blts-wlan-core-tests -en "Core-WLAN-Scan and associate on max power save"
$ blts-wlan-core-tests -en "Core-WLAN-Associate with WPA2-PSK AP"
$ blts-wlan-core-tests -en "Core-WLAN-Disconnect with deauthenticate"
$ blts-wlan-core-tests -en "Core-WLAN-Disconnect with disassociate"
$ blts-wlan-core-tests -en "Core-WLAN-Disconnect with AP loss"
$ blts-wlan-core-tests -en "Core-WLAN-Disconnect from adhoc network"
$ blts-wlan-core-tests -en "Core-WLAN-Establish new adhoc network"
$ blts-wlan-core-tests -en "Core-WLAN-Join established adhoc network"
To run test cases 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-wlan-core-tests.cnf
The configuration file must be edited to match your test environment.
Access point SSID parameters in blts-wlan-core.cnf configuration file:
To run "Core-WLAN-Associate with WEP encryption" case for example, execute the command:
blts-wlan-core-tests -l /var/log/tests/Core-WLAN-Associate_with_WEP_encryption.log -en "Core-WLAN-Associate with WEP encryption" -C /etc/blts/blts-wlan-core-tests.cnf
Example of WEP encryption case variation:
# Parameter configuration for blts-wlan-core
# Valid wlan devices for HW.
[parameter]
name wlan_device
const "wlan0" "wlan1"
[end_parameter]
# SSID for an existing AP (change this to match your environment)
[parameter]
name ssid
const "test-1"
[end_parameter]
# WEP keys - wep key format "i:t:key", space separated
# i = index (0 - 3)
# t = type (a: = ASCII wep key / h: HEX wep key)
# e.g.
# first 0 index ascii wep key abcdef -> 0:a:abcdef
[parameter]
name wep_keys
const "0:a:abcde"
[end_parameter]
# WEP key index (0 - 3) - default key to transmit
[parameter]
name wep_tx_keyidx
const 0
[end_parameter]
# Tests
[test]
name "Core-WLAN-Associate with WEP encryption"
params wlan_device ssid wep_keys wep_tx_keyidx
[end_test]
The test module can be compiled to self-sufficient command line program. Both Debian and RPM packaging is also provided.
| linuxwireless.org | nl80211 website |
| blts-wlan-core | blts-wlan-core tests |
| mac80211_hwsim | mac80211_hwsim software simulator |
| hostapd | hostapd daemon |
| Version | Date | Handled By | Status | Comments |
|---|---|---|---|---|
| 0.1 | 3-Dec-2010 | Aki Nyman | Draft | Page created (refers to blts-wlan-core test package 0.1.3) |