test: Remove driver_test.c
The driver_test.c driver wrapper (-Dtest in wpa_supplicant and driver=test in hostapd) was previously used for testing without real Wi-Fi hardware. mac80211_hwsim-based tests have practically replaced all these needs and there has been no improvements or use for driver_test.c in a long while. Because of this, there has not really been any effort to maintain this older test tool and no justification to change this either. Remove the obsoleted test mechanism to clean up the repository. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
e41e4f9ee3
commit
01b3bbfc66
9 changed files with 0 additions and 2911 deletions
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
[ \ref eapol_test "eapol_test" |
|
[ \ref eapol_test "eapol_test" |
|
||||||
\ref preauth_test "preauth_test" |
|
\ref preauth_test "preauth_test" |
|
||||||
\ref driver_test "driver_test" |
|
|
||||||
\ref unit_tests "Unit tests" |
|
\ref unit_tests "Unit tests" |
|
||||||
\ref wpa_trace "Tracing code" ]
|
\ref wpa_trace "Tracing code" ]
|
||||||
|
|
||||||
|
@ -111,167 +110,6 @@ pre-authentication with AP using BSSID 02:11:22:33:44:55. The
|
||||||
pre-authentication packets would be sent using the eth0 interface.
|
pre-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 to
|
|
||||||
communicate with a network device driver. This design uses \ref
|
|
||||||
driver_wrapper "driver interface API" and number of driver interface
|
|
||||||
implementations. One of these is driver_test.c, i.e., a test driver
|
|
||||||
interface that is actually not using any drivers. Instead, it provides
|
|
||||||
a mechanism for running %wpa_supplicant without having to have a
|
|
||||||
device driver or wireless LAN hardware for that matter.
|
|
||||||
|
|
||||||
driver_test can be used to talk directly with hostapd's driver_test
|
|
||||||
component to create a test setup where one or more clients and access
|
|
||||||
points can be tested within one test host and without having to have
|
|
||||||
multiple wireless cards. This makes it easier to test the core code in
|
|
||||||
%wpa_supplicant, and hostapd for that matter. Since driver_test uses
|
|
||||||
the same driver API than any other driver interface implementation,
|
|
||||||
the core code of %wpa_supplicant and hostapd can be tested with the
|
|
||||||
same coverage as one would get when using real wireless cards. The
|
|
||||||
only area that is not tested is the driver interface implementation
|
|
||||||
(driver_*.c).
|
|
||||||
|
|
||||||
Having the possibility to use simulated network components makes it
|
|
||||||
much easier to do development testing while adding new features and to
|
|
||||||
reproduce reported bugs. As such, it is often easiest to just do most
|
|
||||||
of the development and bug fixing without using real hardware. Once
|
|
||||||
the driver_test setup has been used to implement a new feature or fix
|
|
||||||
a bug, the end result can be verified with wireless LAN cards. In many
|
|
||||||
cases, this may even be unnecessary, depending on what area the
|
|
||||||
feature/bug is relating to. Of course, changes to driver interfaces
|
|
||||||
will still require use of real hardware.
|
|
||||||
|
|
||||||
Since multiple components can be run within a single host, testing of
|
|
||||||
complex network configuration, e.g., large number of clients
|
|
||||||
association with an access point, becomes quite easy. All the tests
|
|
||||||
can also be automated without having to resort to complex test setup
|
|
||||||
using remote access to multiple computers.
|
|
||||||
|
|
||||||
driver_test can be included in the %wpa_supplicant build in the same
|
|
||||||
way as any other driver interface, i.e., by adding the following line
|
|
||||||
into .config:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
CONFIG_DRIVER_TEST=y
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
When 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 any
|
|
||||||
existing network interface. The interface name is used to generate a
|
|
||||||
MAC address, so when using multiple clients, each should use a
|
|
||||||
different interface, e.g., \a sta1, \a sta2, and so on.
|
|
||||||
|
|
||||||
%wpa_supplicant and hostapd are configured in the same way as they
|
|
||||||
would be for normal use. Following example shows a simple test setup
|
|
||||||
for WPA-PSK.
|
|
||||||
|
|
||||||
hostapd is configured with following psk-test.conf configuration file:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
driver=test
|
|
||||||
|
|
||||||
interface=ap1
|
|
||||||
logger_stdout=-1
|
|
||||||
logger_stdout_level=0
|
|
||||||
debug=2
|
|
||||||
dump_file=/tmp/hostapd.dump
|
|
||||||
|
|
||||||
test_socket=/tmp/Test/ap1
|
|
||||||
|
|
||||||
ssid=jkm-test-psk
|
|
||||||
|
|
||||||
wpa=1
|
|
||||||
wpa_key_mgmt=WPA-PSK
|
|
||||||
wpa_pairwise=TKIP
|
|
||||||
wpa_passphrase=12345678
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
and started with following command:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
hostapd psk-test.conf
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
%wpa_supplicant uses following configuration file:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
driver_param=test_socket=/tmp/Test/ap1
|
|
||||||
|
|
||||||
network={
|
|
||||||
ssid="jkm-test-psk"
|
|
||||||
key_mgmt=WPA-PSK
|
|
||||||
psk="12345678"
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
%wpa_supplicant can then be started with following command:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
wpa_supplicant -Dtest -cpsk-test.conf -ista1 -ddK
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
If run without debug information, i.e., with
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
wpa_supplicant -Dtest -cpsk-test.conf -ista1
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
%wpa_supplicant completes authentication and prints following events:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
Trying to associate with 02:b8:a6:62:08:5a (SSID='jkm-test-psk' freq=0 MHz)
|
|
||||||
Associated with 02:b8:a6:62:08:5a
|
|
||||||
WPA: 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)
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
If test setup is using multiple clients, it is possible to run
|
|
||||||
multiple %wpa_supplicant processes. Alternatively, the support for
|
|
||||||
multiple interfaces can be used with just one process to save some
|
|
||||||
resources on single-CPU systems. For example, following command runs
|
|
||||||
two clients:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
./wpa_supplicant -Dtest -cpsk-test.conf -ista1 \
|
|
||||||
-N -Dtest -cpsk-test.conf -ista2
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
This shows following event log:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
Trying to associate with 02:b8:a6:62:08:5a (SSID='jkm-test-psk' freq=0 MHz)
|
|
||||||
Associated with 02:b8:a6:62:08:5a
|
|
||||||
WPA: 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:5a
|
|
||||||
WPA: 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)
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
hostapd shows this with following events:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
ap1: STA 02:b5:64:63:30:63 IEEE 802.11: associated
|
|
||||||
ap1: 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: associated
|
|
||||||
ap1: 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)
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
By default, driver_param is simulating a driver that uses the WPA/RSN
|
|
||||||
IE generated by %wpa_supplicant. Driver-generated IE and AssocInfo
|
|
||||||
events can be tested by adding \a use_associnfo=1 to the \a driver_param
|
|
||||||
line in the configuration file. For example:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
driver_param=test_socket=/tmp/Test/ap1 use_associnfo=1
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
|
|
||||||
\section unit_tests Unit tests
|
\section unit_tests Unit tests
|
||||||
|
|
||||||
Number of the components (.c files) used in %wpa_supplicant define
|
Number of the components (.c files) used in %wpa_supplicant define
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -38,9 +38,6 @@ extern struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
|
||||||
/* driver_macsec_qca.c */
|
/* driver_macsec_qca.c */
|
||||||
extern struct wpa_driver_ops wpa_driver_macsec_qca_ops;
|
extern struct wpa_driver_ops wpa_driver_macsec_qca_ops;
|
||||||
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
||||||
#ifdef CONFIG_DRIVER_TEST
|
|
||||||
extern struct wpa_driver_ops wpa_driver_test_ops; /* driver_test.c */
|
|
||||||
#endif /* CONFIG_DRIVER_TEST */
|
|
||||||
#ifdef CONFIG_DRIVER_ROBOSWITCH
|
#ifdef CONFIG_DRIVER_ROBOSWITCH
|
||||||
/* driver_roboswitch.c */
|
/* driver_roboswitch.c */
|
||||||
extern struct wpa_driver_ops wpa_driver_roboswitch_ops;
|
extern struct wpa_driver_ops wpa_driver_roboswitch_ops;
|
||||||
|
@ -82,9 +79,6 @@ struct wpa_driver_ops *wpa_drivers[] =
|
||||||
#ifdef CONFIG_DRIVER_MACSEC_QCA
|
#ifdef CONFIG_DRIVER_MACSEC_QCA
|
||||||
&wpa_driver_macsec_qca_ops,
|
&wpa_driver_macsec_qca_ops,
|
||||||
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
||||||
#ifdef CONFIG_DRIVER_TEST
|
|
||||||
&wpa_driver_test_ops,
|
|
||||||
#endif /* CONFIG_DRIVER_TEST */
|
|
||||||
#ifdef CONFIG_DRIVER_ROBOSWITCH
|
#ifdef CONFIG_DRIVER_ROBOSWITCH
|
||||||
&wpa_driver_roboswitch_ops,
|
&wpa_driver_roboswitch_ops,
|
||||||
#endif /* CONFIG_DRIVER_ROBOSWITCH */
|
#endif /* CONFIG_DRIVER_ROBOSWITCH */
|
||||||
|
|
|
@ -72,12 +72,6 @@ DRV_CFLAGS += -DCONFIG_DRIVER_OPENBSD
|
||||||
DRV_OBJS += ../src/drivers/driver_openbsd.o
|
DRV_OBJS += ../src/drivers/driver_openbsd.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_DRIVER_TEST
|
|
||||||
DRV_CFLAGS += -DCONFIG_DRIVER_TEST
|
|
||||||
DRV_OBJS += ../src/drivers/driver_test.o
|
|
||||||
NEED_AP_MLME=y
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef CONFIG_DRIVER_NONE
|
ifdef CONFIG_DRIVER_NONE
|
||||||
DRV_CFLAGS += -DCONFIG_DRIVER_NONE
|
DRV_CFLAGS += -DCONFIG_DRIVER_NONE
|
||||||
DRV_OBJS += ../src/drivers/driver_none.o
|
DRV_OBJS += ../src/drivers/driver_none.o
|
||||||
|
|
|
@ -67,12 +67,6 @@ DRV_CFLAGS += -DCONFIG_DRIVER_OPENBSD
|
||||||
DRV_OBJS += src/drivers/driver_openbsd.c
|
DRV_OBJS += src/drivers/driver_openbsd.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_DRIVER_TEST
|
|
||||||
DRV_CFLAGS += -DCONFIG_DRIVER_TEST
|
|
||||||
DRV_OBJS += src/drivers/driver_test.c
|
|
||||||
NEED_AP_MLME=y
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef CONFIG_DRIVER_NONE
|
ifdef CONFIG_DRIVER_NONE
|
||||||
DRV_CFLAGS += -DCONFIG_DRIVER_NONE
|
DRV_CFLAGS += -DCONFIG_DRIVER_NONE
|
||||||
DRV_OBJS += src/drivers/driver_none.c
|
DRV_OBJS += src/drivers/driver_none.c
|
||||||
|
|
|
@ -10,8 +10,6 @@ PKG_CONFIG ?= pkg-config
|
||||||
|
|
||||||
ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
|
ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
|
||||||
CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y
|
CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y
|
||||||
else
|
|
||||||
CONFIG_DRIVER_TEST := y
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(LOCAL_PATH)/android.config
|
include $(LOCAL_PATH)/android.config
|
||||||
|
@ -1500,26 +1498,6 @@ OBJS_priv += wpa_priv.c
|
||||||
ifdef CONFIG_DRIVER_NL80211
|
ifdef CONFIG_DRIVER_NL80211
|
||||||
OBJS_priv += src/common/ieee802_11_common.c
|
OBJS_priv += src/common/ieee802_11_common.c
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_DRIVER_TEST
|
|
||||||
OBJS_priv += $(SHA1OBJS)
|
|
||||||
OBJS_priv += $(MD5OBJS)
|
|
||||||
ifeq ($(CONFIG_TLS), openssl)
|
|
||||||
OBJS_priv += src/crypto/crypto_openssl.c
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_TLS), gnutls)
|
|
||||||
OBJS_priv += src/crypto/crypto_gnutls.c
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_TLS), nss)
|
|
||||||
OBJS_priv += src/crypto/crypto_nss.c
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_TLS), internal)
|
|
||||||
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
|
|
||||||
OBJS_priv += src/crypto/crypto_libtomcrypt.c
|
|
||||||
else
|
|
||||||
OBJS_priv += src/crypto/crypto_internal.c
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif # CONFIG_DRIVER_TEST
|
|
||||||
OBJS += src/l2_packet/l2_packet_privsep.c
|
OBJS += src/l2_packet/l2_packet_privsep.c
|
||||||
OBJS += src/drivers/driver_privsep.c
|
OBJS += src/drivers/driver_privsep.c
|
||||||
EXTRA_progs += wpa_priv
|
EXTRA_progs += wpa_priv
|
||||||
|
|
|
@ -1539,26 +1539,6 @@ OBJS_priv += wpa_priv.o
|
||||||
ifdef CONFIG_DRIVER_NL80211
|
ifdef CONFIG_DRIVER_NL80211
|
||||||
OBJS_priv += ../src/common/ieee802_11_common.o
|
OBJS_priv += ../src/common/ieee802_11_common.o
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_DRIVER_TEST
|
|
||||||
OBJS_priv += $(SHA1OBJS)
|
|
||||||
OBJS_priv += $(MD5OBJS)
|
|
||||||
ifeq ($(CONFIG_TLS), openssl)
|
|
||||||
OBJS_priv += ../src/crypto/crypto_openssl.o
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_TLS), gnutls)
|
|
||||||
OBJS_priv += ../src/crypto/crypto_gnutls.o
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_TLS), nss)
|
|
||||||
OBJS_priv += ../src/crypto/crypto_nss.o
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_TLS), internal)
|
|
||||||
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
|
|
||||||
OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
|
|
||||||
else
|
|
||||||
OBJS_priv += ../src/crypto/crypto_internal.o
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif # CONFIG_DRIVER_TEST
|
|
||||||
OBJS += ../src/l2_packet/l2_packet_privsep.o
|
OBJS += ../src/l2_packet/l2_packet_privsep.o
|
||||||
OBJS += ../src/drivers/driver_privsep.o
|
OBJS += ../src/drivers/driver_privsep.o
|
||||||
EXTRA_progs += wpa_priv
|
EXTRA_progs += wpa_priv
|
||||||
|
|
|
@ -55,9 +55,6 @@ CONFIG_LIBNL20=y
|
||||||
# wpa_supplicant.
|
# wpa_supplicant.
|
||||||
# CONFIG_USE_NDISUIO=y
|
# CONFIG_USE_NDISUIO=y
|
||||||
|
|
||||||
# Driver interface for development testing
|
|
||||||
#CONFIG_DRIVER_TEST=y
|
|
||||||
|
|
||||||
# Driver interface for wired Ethernet drivers
|
# Driver interface for wired Ethernet drivers
|
||||||
#CONFIG_DRIVER_WIRED=y
|
#CONFIG_DRIVER_WIRED=y
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,6 @@ CONFIG_DRIVER_NL80211=y
|
||||||
# wpa_supplicant.
|
# wpa_supplicant.
|
||||||
# CONFIG_USE_NDISUIO=y
|
# CONFIG_USE_NDISUIO=y
|
||||||
|
|
||||||
# Driver interface for development testing
|
|
||||||
#CONFIG_DRIVER_TEST=y
|
|
||||||
|
|
||||||
# Driver interface for wired Ethernet drivers
|
# Driver interface for wired Ethernet drivers
|
||||||
CONFIG_DRIVER_WIRED=y
|
CONFIG_DRIVER_WIRED=y
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue