|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| auth_serv/ | | 11-Mar-2024 | - | 6,484 | 6,092 |
| tnc/ | | 11-Mar-2024 | - | 562 | 394 |
| vm/ | | 11-Mar-2024 | - | 1,846 | 1,571 |
| .gitignore | D | 11-Mar-2024 | 10 | 2 | 1 |
| README | D | 11-Mar-2024 | 8.7 KiB | 221 | 171 |
| build.sh | D | 11-Mar-2024 | 1.7 KiB | 84 | 68 |
| check_kernel.py | D | 11-Mar-2024 | 897 | 32 | 19 |
| devdetail.xml | D | 11-Mar-2024 | 1.2 KiB | 48 | 47 |
| devinfo.xml | D | 11-Mar-2024 | 190 | 8 | 7 |
| dictionary.radius | D | 11-Mar-2024 | 744 | 21 | 20 |
| example-hostapd.config | D | 11-Mar-2024 | 2.5 KiB | 117 | 103 |
| example-setup.txt | D | 11-Mar-2024 | 6.8 KiB | 192 | 142 |
| example-wpa_supplicant.config | D | 11-Mar-2024 | 2.9 KiB | 161 | 124 |
| fst_module_aux.py | D | 11-Mar-2024 | 32.4 KiB | 833 | 710 |
| fst_test_common.py | D | 11-Mar-2024 | 2.7 KiB | 93 | 68 |
| hostapd.py | D | 11-Mar-2024 | 28.7 KiB | 888 | 791 |
| hostapd.vlan | D | 11-Mar-2024 | 25 | 3 | 2 |
| hostapd.vlan2 | D | 11-Mar-2024 | 47 | 4 | 3 |
| hostapd.wlan3.vlan | D | 11-Mar-2024 | 20 | 3 | 2 |
| hostapd.wlan4.vlan | D | 11-Mar-2024 | 20 | 3 | 2 |
| hostapd.wpa_psk | D | 11-Mar-2024 | 236 | 6 | 5 |
| hwsim.py | D | 11-Mar-2024 | 4.5 KiB | 115 | 87 |
| hwsim_utils.py | D | 11-Mar-2024 | 9.5 KiB | 247 | 214 |
| multi-bss-acs.conf | D | 11-Mar-2024 | 404 | 29 | 23 |
| multi-bss-iface-per_sta_vif.conf | D | 11-Mar-2024 | 701 | 43 | 37 |
| multi-bss-iface.conf | D | 11-Mar-2024 | 673 | 41 | 35 |
| multi-bss.conf | D | 11-Mar-2024 | 271 | 22 | 15 |
| netlink.py | D | 11-Mar-2024 | 6.8 KiB | 238 | 192 |
| nl80211.py | D | 11-Mar-2024 | 8.8 KiB | 358 | 342 |
| owe-bss-1.conf | D | 11-Mar-2024 | 179 | 13 | 9 |
| owe-bss-2.conf | D | 11-Mar-2024 | 243 | 17 | 13 |
| p2p0.conf | D | 11-Mar-2024 | 97 | 4 | 3 |
| p2p1.conf | D | 11-Mar-2024 | 97 | 4 | 3 |
| p2p2.conf | D | 11-Mar-2024 | 97 | 4 | 3 |
| p2p_utils.py | D | 11-Mar-2024 | 14.9 KiB | 395 | 362 |
| pps-mo-1.xml | D | 11-Mar-2024 | 2.1 KiB | 63 | 62 |
| radius_das.py | D | 11-Mar-2024 | 1.7 KiB | 48 | 33 |
| remotehost.py | D | 11-Mar-2024 | 7.6 KiB | 260 | 211 |
| rfkill.py | D | 11-Mar-2024 | 3.6 KiB | 153 | 120 |
| run-all.sh | D | 11-Mar-2024 | 3.1 KiB | 163 | 140 |
| run-tests.py | D | 11-Mar-2024 | 26.7 KiB | 693 | 616 |
| start.sh | D | 11-Mar-2024 | 5.9 KiB | 214 | 184 |
| stop.sh | D | 11-Mar-2024 | 2 KiB | 81 | 68 |
| test_ap_acs.py | D | 11-Mar-2024 | 24.9 KiB | 689 | 576 |
| test_ap_ciphers.py | D | 11-Mar-2024 | 45.5 KiB | 1,201 | 1,012 |
| test_ap_config.py | D | 11-Mar-2024 | 24.7 KiB | 582 | 514 |
| test_ap_csa.py | D | 11-Mar-2024 | 6.4 KiB | 190 | 144 |
| test_ap_dynamic.py | D | 11-Mar-2024 | 21.9 KiB | 587 | 513 |
| test_ap_eap.py | D | 11-Mar-2024 | 331.9 KiB | 7,512 | 6,680 |
| test_ap_ft.py | D | 11-Mar-2024 | 137.8 KiB | 3,515 | 2,901 |
| test_ap_hs20.py | D | 11-Mar-2024 | 262.4 KiB | 6,499 | 5,596 |
| test_ap_ht.py | D | 11-Mar-2024 | 60.1 KiB | 1,645 | 1,415 |
| test_ap_mixed.py | D | 11-Mar-2024 | 4.2 KiB | 102 | 84 |
| test_ap_open.py | D | 11-Mar-2024 | 40.1 KiB | 1,018 | 860 |
| test_ap_params.py | D | 11-Mar-2024 | 37.9 KiB | 974 | 889 |
| test_ap_pmf.py | D | 11-Mar-2024 | 49.3 KiB | 1,230 | 1,075 |
| test_ap_psk.py | D | 11-Mar-2024 | 141.3 KiB | 3,574 | 2,945 |
| test_ap_qosmap.py | D | 11-Mar-2024 | 7.5 KiB | 170 | 153 |
| test_ap_roam.py | D | 11-Mar-2024 | 15.5 KiB | 398 | 333 |
| test_ap_tdls.py | D | 11-Mar-2024 | 24.8 KiB | 655 | 593 |
| test_ap_track.py | D | 11-Mar-2024 | 15.9 KiB | 438 | 365 |
| test_ap_vht.py | D | 11-Mar-2024 | 54.8 KiB | 1,348 | 1,202 |
| test_ap_vlan.py | D | 11-Mar-2024 | 32.6 KiB | 807 | 667 |
| test_ap_wps.py | D | 11-Mar-2024 | 418.3 KiB | 10,610 | 9,230 |
| test_authsrv.py | D | 11-Mar-2024 | 11.6 KiB | 263 | 223 |
| test_autoscan.py | D | 11-Mar-2024 | 3.2 KiB | 82 | 67 |
| test_bgscan.py | D | 11-Mar-2024 | 12 KiB | 316 | 253 |
| test_cert_check.py | D | 11-Mar-2024 | 11.9 KiB | 313 | 270 |
| test_cfg80211.py | D | 11-Mar-2024 | 6.6 KiB | 151 | 111 |
| test_connect_cmd.py | D | 11-Mar-2024 | 9.6 KiB | 255 | 198 |
| test_dbus.py | D | 11-Mar-2024 | 252.7 KiB | 6,210 | 5,300 |
| test_dfs.py | D | 11-Mar-2024 | 28 KiB | 768 | 621 |
| test_dpp.py | D | 11-Mar-2024 | 314.6 KiB | 7,293 | 6,127 |
| test_dpp3.py | D | 11-Mar-2024 | 10.1 KiB | 278 | 228 |
| test_dscp.py | D | 11-Mar-2024 | 15.4 KiB | 408 | 312 |
| test_eap.py | D | 11-Mar-2024 | 27.5 KiB | 603 | 535 |
| test_eap_proto.py | D | 11-Mar-2024 | 444 KiB | 10,377 | 9,197 |
| test_erp.py | D | 11-Mar-2024 | 31.2 KiB | 740 | 660 |
| test_ext_password.py | D | 11-Mar-2024 | 4.8 KiB | 113 | 98 |
| test_fils.py | D | 11-Mar-2024 | 95.7 KiB | 2,464 | 2,085 |
| test_fst_config.py | D | 11-Mar-2024 | 22.6 KiB | 553 | 472 |
| test_fst_module.py | D | 11-Mar-2024 | 128.4 KiB | 2,826 | 2,397 |
| test_gas.py | D | 11-Mar-2024 | 82 KiB | 2,058 | 1,725 |
| test_hapd_ctrl.py | D | 11-Mar-2024 | 46.4 KiB | 1,078 | 976 |
| test_he.py | D | 11-Mar-2024 | 53.6 KiB | 1,348 | 1,190 |
| test_hostapd_oom.py | D | 11-Mar-2024 | 6.5 KiB | 174 | 152 |
| test_hs20_filter.py | D | 11-Mar-2024 | 8.1 KiB | 206 | 160 |
| test_hs20_pps_mo.py | D | 11-Mar-2024 | 1.5 KiB | 44 | 32 |
| test_ibss.py | D | 11-Mar-2024 | 22.9 KiB | 602 | 478 |
| test_ieee8021x.py | D | 11-Mar-2024 | 21 KiB | 532 | 459 |
| test_kernel.py | D | 11-Mar-2024 | 4.4 KiB | 129 | 85 |
| test_macsec.py | D | 11-Mar-2024 | 32.4 KiB | 902 | 764 |
| test_mbo.py | D | 11-Mar-2024 | 25.3 KiB | 614 | 515 |
| test_module_tests.py | D | 11-Mar-2024 | 889 | 29 | 18 |
| test_monitor_interface.py | D | 11-Mar-2024 | 3.6 KiB | 95 | 72 |
| test_mscs.py | D | 11-Mar-2024 | 8.3 KiB | 232 | 181 |
| test_multi_ap.py | D | 11-Mar-2024 | 16.2 KiB | 369 | 302 |
| test_nfc_p2p.py | D | 11-Mar-2024 | 36.7 KiB | 842 | 739 |
| test_nfc_wps.py | D | 11-Mar-2024 | 32.4 KiB | 698 | 647 |
| test_oce.py | D | 11-Mar-2024 | 6.1 KiB | 186 | 140 |
| test_ocv.py | D | 11-Mar-2024 | 48.3 KiB | 1,252 | 1,083 |
| test_offchannel_tx.py | D | 11-Mar-2024 | 1.9 KiB | 51 | 37 |
| test_owe.py | D | 11-Mar-2024 | 36.1 KiB | 954 | 814 |
| test_p2p_autogo.py | D | 11-Mar-2024 | 36.7 KiB | 937 | 802 |
| test_p2p_channel.py | D | 11-Mar-2024 | 56.7 KiB | 1,385 | 1,166 |
| test_p2p_concurrency.py | D | 11-Mar-2024 | 11.2 KiB | 287 | 238 |
| test_p2p_device.py | D | 11-Mar-2024 | 23.8 KiB | 553 | 472 |
| test_p2p_discovery.py | D | 11-Mar-2024 | 35 KiB | 872 | 750 |
| test_p2p_ext.py | D | 11-Mar-2024 | 15.8 KiB | 385 | 345 |
| test_p2p_grpform.py | D | 11-Mar-2024 | 49.7 KiB | 1,186 | 1,048 |
| test_p2p_invitation.py | D | 11-Mar-2024 | 7.2 KiB | 196 | 154 |
| test_p2p_messages.py | D | 11-Mar-2024 | 87.3 KiB | 2,144 | 1,821 |
| test_p2p_persistent.py | D | 11-Mar-2024 | 28.6 KiB | 677 | 590 |
| test_p2p_service.py | D | 11-Mar-2024 | 26.1 KiB | 587 | 501 |
| test_p2p_set.py | D | 11-Mar-2024 | 4.7 KiB | 129 | 107 |
| test_p2p_wifi_display.py | D | 11-Mar-2024 | 19.9 KiB | 476 | 392 |
| test_p2ps.py | D | 11-Mar-2024 | 76.1 KiB | 1,690 | 1,381 |
| test_pasn.py | D | 11-Mar-2024 | 28.6 KiB | 855 | 630 |
| test_pmksa_cache.py | D | 11-Mar-2024 | 51.6 KiB | 1,268 | 1,099 |
| test_radio_work.py | D | 11-Mar-2024 | 5.3 KiB | 134 | 108 |
| test_radius.py | D | 11-Mar-2024 | 72 KiB | 1,730 | 1,518 |
| test_rfkill.py | D | 11-Mar-2024 | 8.1 KiB | 243 | 201 |
| test_rrm.py | D | 11-Mar-2024 | 90.2 KiB | 2,149 | 1,672 |
| test_sae.py | D | 11-Mar-2024 | 113.1 KiB | 2,787 | 2,421 |
| test_sae_pk.py | D | 11-Mar-2024 | 17.8 KiB | 463 | 387 |
| test_scan.py | D | 11-Mar-2024 | 78.8 KiB | 2,026 | 1,641 |
| test_scs.py | D | 11-Mar-2024 | 10.5 KiB | 197 | 166 |
| test_sigma_dut.py | D | 11-Mar-2024 | 248.9 KiB | 5,461 | 4,691 |
| test_ssid.py | D | 11-Mar-2024 | 5.1 KiB | 128 | 106 |
| test_sta_dynamic.py | D | 11-Mar-2024 | 13.3 KiB | 330 | 277 |
| test_suite_b.py | D | 11-Mar-2024 | 30.5 KiB | 740 | 660 |
| test_tnc.py | D | 11-Mar-2024 | 8.3 KiB | 195 | 166 |
| test_wep.py | D | 11-Mar-2024 | 6.7 KiB | 173 | 155 |
| test_wext.py | D | 11-Mar-2024 | 9.2 KiB | 255 | 204 |
| test_wmediumd.py | D | 11-Mar-2024 | 16.2 KiB | 481 | 370 |
| test_wnm.py | D | 11-Mar-2024 | 88.8 KiB | 1,989 | 1,710 |
| test_wpas_ap.py | D | 11-Mar-2024 | 40.5 KiB | 1,102 | 960 |
| test_wpas_config.py | D | 11-Mar-2024 | 24.8 KiB | 664 | 566 |
| test_wpas_ctrl.py | D | 11-Mar-2024 | 97.3 KiB | 2,174 | 1,918 |
| test_wpas_mesh.py | D | 11-Mar-2024 | 93.8 KiB | 2,552 | 2,080 |
| test_wpas_wmm_ac.py | D | 11-Mar-2024 | 15.3 KiB | 401 | 297 |
| tshark.py | D | 11-Mar-2024 | 3.9 KiB | 125 | 102 |
| utils.py | D | 11-Mar-2024 | 9.6 KiB | 307 | 258 |
| w1fi_logo.png | D | 11-Mar-2024 | 7.4 KiB | | |
| wlantest.py | D | 11-Mar-2024 | 9.6 KiB | 278 | 231 |
| wpasupplicant.py | D | 11-Mar-2024 | 60.1 KiB | 1,668 | 1,500 |
| wps-ctrl-cred | D | 11-Mar-2024 | 67 | | |
| wps-ctrl-cred2 | D | 11-Mar-2024 | 59 | | |
| wps-mixed-cred | D | 11-Mar-2024 | 112 | | |
| wps-wep-cred | D | 11-Mar-2024 | 53 | | |
README
1Automated hostapd/wpa_supplicant testing with mac80211_hwsim
2------------------------------------------------------------
3
4This directory contains testing infrastructure and test cases to run
5automated tests of full hostapd and wpa_supplicant functionality. This
6testing is done with the help of mac80211_hwsim which is Linux kernel
7driver that simulates IEEE 802.11 radios without requiring any
8additional hardware. This setup most of the hostapd and wpa_supplicant
9functionality (and large parts of the Linux cfg80211 and mac80211
10functionality for that matter) to be tested.
11
12mac80211_hwsim is loaded with five simulated radios to allow different
13device combinations to be tested. wlantest is used analyze raw packets
14captured through the hwsim0 monitor interface that capture all frames
15sent on all channels. wlantest is used to store the frames for
16analysis. Three wpa_supplicant processes are used to control three
17virtual radios and one hostapd process is used to dynamically control
18the other two virtual radios. wpa_supplicant/hostapd test functionality
19is used to verify that data connection (both unicast and broadcast)
20works between two netdevs.
21
22The python scripts and tools in this directory control test case
23execution. They interact wpa_supplicant and hostapd through control
24interfaces to perform the operations. In addition, wlantest_cli is used
25to verify that operations have been performed correctly and that the
26network connection works in the expected way.
27
28These test cases are run automatically against the hostap.git commits
29for regression testing and to help in keeping the hostap.git main
30branch in stable state. Results from these tests are available here:
31http://buildbot.w1.fi/hwsim/
32
33
34Building binaries for testing
35-----------------------------
36
37You will need to build (or use already built) components to be
38tested. These are available in the hostap.git repository and can be
39built for example as follows:
40
41cd ../../wpa_supplicant
42cp ../tests/hwsim/example-wpa_supplicant.config .config
43make clean
44make
45cd ../hostapd
46cp ../tests/hwsim/example-hostapd.config .config
47make clean
48make hostapd hostapd_cli hlr_auc_gw
49cd ../wlantest
50make clean
51make
52
53Alternatively, the build.sh script here can be used to run these steps
54with conditional creation of .config files only if they do not exist.
55
56The test scripts can find the binaries in the locations where they were
57built. It is also possible to install wlantest_cli somewhere on the path
58to use pre-built tools.
59
60Please note that some of the configuration parameters used to enable
61more testing coverage may require development packages that may not be
62installed by default in many distributions. For example, following
63Debian/Ubuntu packages are likely to be needed:
64- binutils-dev
65- libsqlite3-dev
66- libpcap-dev
67
68example-setup.txt provides more complete step-by-step example on how a
69test setup can be built.
70
71
72wpaspy
73------
74
75The python scripts use wpaspy.py to interact with the wpa_supplicant
76control interface, but the run-tests.py script adds the (relative)
77path into the environment so it doesn't need to be installed.
78
79
80mac80211_hwsim
81--------------
82
83mac80211_hwsim kernel module is available from the upstream Linux
84kernel. Some Linux distributions enable it by default. If that's not the
85case, you can either enable it in the kernel configuration
86(CONFIG_MAC80211_HWSIM=m) and rebuild your kernel or use Backports with
87CPTCFG_MAC80211_HWSIM=m to replace the wireless LAN components in the
88base kernel.
89
90
91sudo
92----
93
94Some parts of the testing process requires root privileges. The test
95scripts are currently using sudo to achieve this. To be able to run the
96tests, you'll probably want to enable sudo with a timeout to not expire
97password entry very quickly. For example, use this in the sudoers file:
98
99Defaults env_reset,timestamp_timeout=180
100
101Or on a dedicated test system, you could even disable password prompting
102with this in sudoers:
103
104%sudo ALL=NOPASSWD: ALL
105
106
107Other network interfaces
108------------------------
109
110Some of the test scripts are still using hardcoded interface names, so
111the easiest way of making things work is to avoid using other network
112devices that may use conflicting interface names. For example, unload
113any wireless LAN driver before running the tests and make sure that
114wlan0..4 gets assigned as the interface names for the mac80211_hwsim
115radios. It may also be possible to rename the interface expectations in
116run-tests.py to allow other names to be used.
117
118Please also note that some commonly enabled tools, like NetworkManager,
119may end up trying to control new network interfaces automatically. This
120can result in conflicts with the test scripts and you may need to
121disable such network services or at least mark the mac80211_hwsim wlan#
122interfaces as umanaged. As an example, this can be done in
123/etc/NetworkManager/NetworkManager.conf with following addition:
124
125[keyfile]
126unmanaged-devices=mac:02:00:00:00:00:00;mac:02:00:00:00:01:00;mac:02:00:00:00:02:00;mac:02:00:00:00:03:00;mac:02:00:00:00:04:00
127
128
129Running tests
130-------------
131
132Simplest way to run a full set of the test cases is by running
133run-all.sh in tests/hwsim directory. This will use start.sh to load the
134mac80211_hwsim module and start wpa_supplicant, hostapd, and various
135test tools. run-tests.sh is then used to run through all the defined
136test cases and stop.sh to stop the programs and unload the kernel
137module.
138
139run-all.sh can be used to run the same test cases under different
140conditions:
141
142# run normal test cases
143./run-all.sh
144
145# run normal test cases under valgrind
146./run-all.sh valgrind
147
148# run normal test cases with Linux tracing
149./run-all.sh trace
150
151# run normal test cases with multi channel support (see details below)
152./run-all.sh channels=<num of channels>
153
154run-all.sh directs debug logs into the logs subdirectory (or $LOGDIR if
155present in the environment). Log file names include the current UNIX
156timestamp and a postfix to identify the specific log:
157- *.log0 = wpa_supplicant debug log for the first radio
158- *.log1 = wpa_supplicant debug log for the second radio
159- *.log2 = wpa_supplicant debug log for the third radio
160- *.hostapd = hostapd debug log
161- hwsim0 = wlantest debug log
162- hwsim0.pcapng = capture with all frames exchanged during the tests
163- *.log = debug prints from the test scripts
164- trace.dat = Linux tracing record (if enabled)
165- hlr_auc_gw - hlr_auc_gw (EAP-SIM/AKA/AKA' authentication) log
166- auth_serv - hostapd as RADIUS authentication server log
167
168
169For manual testing, ./start.sh can be used to initialize interfaces and
170programs and run-tests.py to execute one or more test
171cases. run-tests.py output verbosity can be controlled with -d (more
172verbose debug output) and -q (less verbose output) on the command
173line. "-f <module name>" (pointing to file test_<module name>.py) can be
174used to specify that all test cases from a single file are to be
175run. Test name as the last command line argument can be specified that a
176single test case is to be run (e.g., "./run-tests.py ap_pmf_required").
177
178Notice that some tests require the driver to support concurrent
179operation on multi channels in order to run. These tests will be skipped
180in case the driver does not support multi channels. To enable support
181for multi channel, the number of supported channel is passed as an
182argument to run-all.sh or start.sh
183
184
185Adding/modifying test cases
186---------------------------
187
188All the test cases are defined in the test_*.py files. These are python
189scripts that can use the local helper classes to interact with the test
190components. While various python constructs can be used in the scripts,
191only a minimal level of python knowledge should really be needed to
192modify and add new test cases. The easiest starting point for this is
193likely to take a look at some of the example scripts. When working on a
194new test, run-tests.py with -d and the test case name on the command
195line is a convenient way of verifying functionality.
196
197run-tests.py will automatically import all test cases from the test_*.py
198files in this directory. All functions starting with the "test_" prefix
199in these files are assumed to be test cases. Each test case is named by
200the function name following the "test_" prefix.
201
202
203Results database
204----------------
205
206run-tests.py can be requested to write results from the execution of
207each test case into an sqlite database. The "-S <path to database>" and
208"-b <build id>" command line arguments can be used to do that. The
209database must have been prepared before this, e.g., with following:
210
211cat | sqlite3 /tmp/example.db <<EOF
212CREATE TABLE results (test,result,run,time,duration,build,commitid);
213CREATE INDEX results_idx ON results (test);
214CREATE INDEX results_idx2 ON results (run);
215CREATE TABLE tests (test,description);
216CREATE UNIQUE INDEX tests_idx ON tests (test);
217CREATE TABLE logs (test,run,type,contents);
218CREATE INDEX logs_idx ON logs (test);
219CREATE INDEX logs_idx2 ON logs (run);
220EOF
221