From 9d2cb3ec94f3a96864b680de5a8cec0aeed0ff94 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 28 Nov 2013 15:34:24 +0200 Subject: [PATCH] Make CONFIG_TESTING_OPTIONS=y enable all testing options This makes it easier to enable various testing parameters and functionality in build configuration. Signed-hostap: Jouni Malinen --- hostapd/Makefile | 9 +++++---- tests/hwsim/example-hostapd.config | 2 ++ tests/hwsim/example-wpa_supplicant.config | 2 ++ wpa_supplicant/Makefile | 6 ++++++ wpa_supplicant/ctrl_iface.c | 4 ++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/hostapd/Makefile b/hostapd/Makefile index e60ae9bea..753781406 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -15,6 +15,11 @@ CFLAGS += -I$(abspath ../src/utils) -include .config +ifdef CONFIG_TESTING_OPTIONS +CFLAGS += -DCONFIG_TESTING_OPTIONS +CONFIG_WPS_TESTING=y +endif + ifndef CONFIG_OS ifdef CONFIG_NATIVE_WINDOWS CONFIG_OS=win32 @@ -858,10 +863,6 @@ LIBS += -lsqlite3 LIBS_h += -lsqlite3 endif -ifdef CONFIG_TESTING_OPTIONS -CFLAGS += -DCONFIG_TESTING_OPTIONS -endif - ALL=hostapd hostapd_cli all: verify_config $(ALL) diff --git a/tests/hwsim/example-hostapd.config b/tests/hwsim/example-hostapd.config index 89dc6a883..c565e428c 100644 --- a/tests/hwsim/example-hostapd.config +++ b/tests/hwsim/example-hostapd.config @@ -68,3 +68,5 @@ CONFIG_HS20=y #CONFIG_SQLITE=y CONFIG_SAE=y CFLAGS += -DALL_DH_GROUPS + +CONFIG_TESTING_OPTIONS=y diff --git a/tests/hwsim/example-wpa_supplicant.config b/tests/hwsim/example-wpa_supplicant.config index 34525ccf8..67c9768d4 100644 --- a/tests/hwsim/example-wpa_supplicant.config +++ b/tests/hwsim/example-wpa_supplicant.config @@ -110,6 +110,8 @@ CFLAGS += -DALL_DH_GROUPS CONFIG_WNM=y +CONFIG_TESTING_OPTIONS=y + # gcov code coverage from the virtual machine #CONFIG_CODE_COVERAGE=y #CFLAGS += -fprofile-dir=/tmp/logs/gcov diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index 8ade64c17..2c709c330 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -15,6 +15,12 @@ CFLAGS += -I$(abspath ../src/utils) -include .config +ifdef CONFIG_TESTING_OPTIONS +CFLAGS += -DCONFIG_TESTING_OPTIONS +CONFIG_WPS_TESTING=y +CONFIG_TDLS_TESTING=y +endif + BINALL=wpa_supplicant wpa_cli ifndef CONFIG_NO_WPA_PASSPHRASE diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index f09c886f4..0495c5b94 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -361,13 +361,13 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } else if (os_strcasecmp(cmd, "ampdu") == 0) { if (wpa_drv_ampdu(wpa_s, atoi(value)) < 0) ret = -1; +#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS_TESTING } else if (os_strcasecmp(cmd, "tdls_testing") == 0) { extern unsigned int tdls_testing; tdls_testing = strtol(value, NULL, 0); wpa_printf(MSG_DEBUG, "TDLS: tdls_testing=0x%x", tdls_testing); #endif /* CONFIG_TDLS_TESTING */ -#ifdef CONFIG_TDLS } else if (os_strcasecmp(cmd, "tdls_disabled") == 0) { int disabled = atoi(value); wpa_printf(MSG_DEBUG, "TDLS: tdls_disabled=%d", disabled); @@ -5172,11 +5172,11 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s) wpa_s->after_wps = 0; wpa_s->known_wps_freq = 0; +#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS_TESTING extern unsigned int tdls_testing; tdls_testing = 0; #endif /* CONFIG_TDLS_TESTING */ -#ifdef CONFIG_TDLS wpa_drv_tdls_oper(wpa_s, TDLS_ENABLE, NULL); wpa_tdls_enable(wpa_s->wpa, 1); #endif /* CONFIG_TDLS */