⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testing_tools.doxygen

📁 via usb driver that support vt6656 chipsets
💻 DOXYGEN
字号:
/**\page testing_tools Testing and development tools[ \ref eapol_test "eapol_test" |\ref preauth_test "preauth_test" |\ref driver_test "driver_test" |\ref unit_tests "Unit tests" ]%wpa_supplicant source tree includes number of testing and developmenttools that make it easier to test the programs without having to setupa full test setup with wireless cards. In addition, these tools can beused to implement automatic tests suites.\section eapol_test eapol_test - EAP peer and RADIUS client testingeapol_test is a program that links together the same EAP peerimplementation that %wpa_supplicant is using and the RADIUSauthentication client code from hostapd. In addition, it has minimalglue code to combine these two components in similar ways to IEEE802.1X/EAPOL Authenticator state machines. In other words, itintegrates IEEE 802.1X Authenticator (normally, an access point) andIEEE 802.1X Supplicant (normally, a wireless client) together togenerate a single program that can be used to test EAP methods withouthaving to setup an access point and a wireless client.The main uses for eapol_test are in interoperability testing of EAPmethods against RADIUS servers and in development testing for new EAPmethods. It can be easily used to automate EAP testing forinteroperability and regression since the program can be run fromshell scripts without require additional test components apart from aRADIUS server. For example, the automated EAP tests described ineap_testing.txt are implemented with eapol_test. Similarly, eapol_testcould be used to implement an automated regression test suite for aRADIUS authentication server.eapol_test uses the same build time configuration file, .config, as%wpa_supplicant. This file is used to select which EAP methods areincluded in eapol_test. This program is not built with the defaultMakefile target, so a separate make command needs to be used tocompile the tool:\verbatimmake eapol_test\endverbatimThe resulting eapol_test binary has following command like options:\verbatimusage:eapol_test [-nW] -c<conf> [-a<AS IP>] [-p<AS port>] [-s<AS secret>] [-r<count>]eapol_test scardeapol_test sim <PIN> <num triplets> [debug]options:  -c<conf> = configuration file  -a<AS IP> = IP address of the authentication server, default 127.0.0.1  -p<AS port> = UDP port of the authentication server, default 1812  -s<AS secret> = shared secret with the authentication server, default 'radius'  -r<count> = number of re-authentications  -W = wait for a control interface monitor before starting  -n = no MPPE keys expected\endverbatimAs an example,\verbatimeapol_test -ctest.conf -a127.0.0.1 -p1812 -ssecret -r1\endverbatimtries to complete EAP authentication based on the networkconfiguration from test.conf against the RADIUS server running on thelocal host. A re-authentication is triggered to test fastre-authentication. The configuration file uses the same format fornetwork blocks as %wpa_supplicant.\section preauth_test preauth_test - WPA2 pre-authentication and EAP peer testingpreauth_test is similar to eapol_test in the sense that in combinesEAP peer implementation with something else, in this case, with WPA2pre-authentication. This tool can be used to test pre-authenticationbased on the code that %wpa_supplicant is using. As such, it testsboth the %wpa_supplicant implementation and the functionality of anaccess point.preauth_test is built with:\verbatimmake preauth_test\endverbatimand it uses following command line arguments:\verbatimusage: preauth_test <conf> <target MAC address> <ifname>\endverbatimFor example,\verbatimpreauth_test test.conf 02:11:22:33:44:55 eth0\endverbatimwould use network configuration from test.conf to try to completepre-authentication with AP using BSSID 02:11:22:33:44:55. Thepre-authentication packets would be sent using the eth0 interface.\section driver_test driver_test - driver interface for testing wpa_supplicant%wpa_supplicant was designed to support number of different ways tocommunicate with a network device driver. This design uses \refdriver_wrapper "driver interface API" and number of driver interfaceimplementations. One of these is driver_test.c, i.e., a test driverinterface that is actually not using any drivers. Instead, it providesa mechanism for running %wpa_supplicant without having to have adevice driver or wireless LAN hardware for that matter.driver_test can be used to talk directly with hostapd's driver_testcomponent to create a test setup where one or more clients and accesspoints can be tested within one test host and without having to havemultiple wireless cards. This makes it easier to test the core code in%wpa_supplicant, and hostapd for that matter. Since driver_test usesthe same driver API than any other driver interface implementation,the core code of %wpa_supplicant and hostapd can be tested with thesame coverage as one would get when using real wireless cards. Theonly area that is not tested is the driver interface implementation(driver_*.c).Having the possibility to use simulated network components makes itmuch easier to do development testing while adding new features and toreproduce reported bugs. As such, it is often easiest to just do mostof the development and bug fixing without using real hardware. Oncethe driver_test setup has been used to implement a new feature or fixa bug, the end result can be verified with wireless LAN cards. In manycases, this may even be unnecessary, depending on what area thefeature/bug is relating to. Of course, changes to driver interfaceswill still require use of real hardware.Since multiple components can be run within a single host, testing ofcomplex network configuration, e.g., large number of clientsassociation with an access point, becomes quite easy. All the testscan also be automated without having to resort to complex test setupusing remote access to multiple computers.driver_test can be included in the %wpa_supplicant build in the sameway as any other driver interface, i.e., by adding the following lineinto .config:\verbatimCONFIG_DRIVER_TEST=y\endverbatimWhen running %wpa_supplicant, the test interface is selected by using\a -Dtest command line argument. The interface name (\a -i argument)can be selected arbitrarily, i.e., it does not need to match with anyexisting network interface. The interface name is used to generate aMAC address, so when using multiple clients, each should use adifferent interface, e.g., \a sta1, \a sta2, and so on.%wpa_supplicant and hostapd are configured in the same way as theywould be for normal use. Following example shows a simple test setupfor WPA-PSK.hostapd is configured with following psk-test.conf configuration file:\verbatimdriver=testinterface=ap1logger_stdout=-1logger_stdout_level=0debug=2dump_file=/tmp/hostapd.dumptest_socket=/tmp/Test/ap1ssid=jkm-test-pskwpa=1wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIPwpa_passphrase=12345678\endverbatimand started with following command:\verbatimhostapd psk-test.conf\endverbatim%wpa_supplicant uses following configuration file:\verbatimdriver_param=test_socket=/tmp/Test/ap1network={    ssid="jkm-test-psk"    key_mgmt=WPA-PSK    psk="12345678"}\endverbatim%wpa_supplicant can then be started with following command:\verbatimwpa_supplicant -Dtest -cpsk-test.conf -ista1 -ddK\endverbatimIf run without debug information, i.e., with\verbatimwpa_supplicant -Dtest -cpsk-test.conf -ista1\endverbatim%wpa_supplicant completes authentication and prints following events:\verbatimTrying to associate with 02:b8:a6:62:08:5a (SSID='jkm-test-psk' freq=0 MHz)Associated with 02:b8:a6:62:08:5aWPA: Key negotiation completed with 02:b8:a6:62:08:5a [PTK=TKIP GTK=TKIP]CTRL-EVENT-CONNECTED - Connection to 02:b8:a6:62:08:5a completed (auth)\endverbatimIf test setup is using multiple clients, it is possible to runmultiple %wpa_supplicant processes. Alternatively, the support formultiple interfaces can be used with just one process to save someresources on single-CPU systems. For example, following command runstwo clients:\verbatim./wpa_supplicant -Dtest -cpsk-test.conf -ista1 \	-N -Dtest -cpsk-test.conf -ista2\endverbatimThis shows following event log:\verbatimTrying to associate with 02:b8:a6:62:08:5a (SSID='jkm-test-psk' freq=0 MHz)Associated with 02:b8:a6:62:08:5aWPA: Key negotiation completed with 02:b8:a6:62:08:5a [PTK=TKIP GTK=TKIP]CTRL-EVENT-CONNECTED - Connection to 02:b8:a6:62:08:5a completed (auth)Trying to associate with 02:b8:a6:62:08:5a (SSID='jkm-test-psk' freq=0 MHz)Associated with 02:b8:a6:62:08:5aWPA: Key negotiation completed with 02:b8:a6:62:08:5a [PTK=TKIP GTK=TKIP]CTRL-EVENT-CONNECTED - Connection to 02:b8:a6:62:08:5a completed (auth)\endverbatimhostapd shows this with following events:\verbatimap1: STA 02:b5:64:63:30:63 IEEE 802.11: associatedap1: STA 02:b5:64:63:30:63 WPA: pairwise key handshake completed (WPA)ap1: STA 02:b5:64:63:30:63 WPA: group key handshake completed (WPA)ap1: STA 02:2a:c4:18:5b:f3 IEEE 802.11: associatedap1: STA 02:2a:c4:18:5b:f3 WPA: pairwise key handshake completed (WPA)ap1: STA 02:2a:c4:18:5b:f3 WPA: group key handshake completed (WPA)\endverbatimBy default, driver_param is simulating a driver that uses the WPA/RSNIE generated by %wpa_supplicant. Driver-generated IE and AssocInfoevents can be tested by adding \a use_associnfo=1 to the \a driver_paramline in the configuration file. For example:\verbatimdriver_param=test_socket=/tmp/Test/ap1 use_associnfo=1\endverbatim\section unit_tests Unit testsNumber of the components (.c files) used in %wpa_supplicant definetheir own unit tests for automated validation of the basicfunctionality. Most of the tests for cryptographic algorithms areusing standard test vectors to validate functionality. These tests canbe useful especially when verifying port to a new CPU target.In most cases, these tests are implemented in the end of the same filewith functions that are normally commented out, but ca be included bydefining a pre-processor variable when building the file separately.The details of the needed build options are included in the Makefile(test-* targets). All automated unit tests can be run with\verbatimmake tests\endverbatimThis make target builds and runs each test and terminates with zeroexit code if all tests were completed successfully.*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -