From 4fb6963b3952811e6cd063df5a0114c9e0cdf2b3 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 31 Dec 2018 10:50:22 +0200 Subject: [PATCH] tests: Build tests for wpa_supplicant and hostapd Allow multiple build configurations to be tested automatically. Signed-off-by: Jouni Malinen --- tests/build/build-hostapd-empty.config | 1 + tests/build/build-hostapd-internal.config | 90 ++++++++++++ tests/build/build-hostapd-minimal.config | 17 +++ tests/build/build-hostapd.sh | 36 +++++ tests/build/build-wpa_supplicant-basic.config | 7 + ...uild-wpa_supplicant-dbus_without_ap.config | 2 + tests/build/build-wpa_supplicant-empty.config | 1 + .../build/build-wpa_supplicant-gnutls.config | 17 +++ .../build-wpa_supplicant-internal.config | 129 ++++++++++++++++++ tests/build/build-wpa_supplicant-p2p.config | 8 ++ tests/build/build-wpa_supplicant.sh | 36 +++++ tests/build/run-build-tests.sh | 20 +++ 12 files changed, 364 insertions(+) create mode 100644 tests/build/build-hostapd-empty.config create mode 100644 tests/build/build-hostapd-internal.config create mode 100644 tests/build/build-hostapd-minimal.config create mode 100755 tests/build/build-hostapd.sh create mode 100644 tests/build/build-wpa_supplicant-basic.config create mode 100644 tests/build/build-wpa_supplicant-dbus_without_ap.config create mode 100644 tests/build/build-wpa_supplicant-empty.config create mode 100644 tests/build/build-wpa_supplicant-gnutls.config create mode 100644 tests/build/build-wpa_supplicant-internal.config create mode 100644 tests/build/build-wpa_supplicant-p2p.config create mode 100755 tests/build/build-wpa_supplicant.sh create mode 100755 tests/build/run-build-tests.sh diff --git a/tests/build/build-hostapd-empty.config b/tests/build/build-hostapd-empty.config new file mode 100644 index 000000000..f5effe207 --- /dev/null +++ b/tests/build/build-hostapd-empty.config @@ -0,0 +1 @@ +CFLAGS += -Werror diff --git a/tests/build/build-hostapd-internal.config b/tests/build/build-hostapd-internal.config new file mode 100644 index 000000000..3af813e76 --- /dev/null +++ b/tests/build/build-hostapd-internal.config @@ -0,0 +1,90 @@ +CFLAGS += -Werror + +CONFIG_DRIVER_NONE=y +CONFIG_DRIVER_NL80211=y +CONFIG_RSN_PREAUTH=y + +CONFIG_TLS=internal +CONFIG_INTERNAL_LIBTOMMATH=y +CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +CONFIG_EAP=y +CONFIG_ERP=y +CONFIG_EAP_MD5=y +CONFIG_EAP_TLS=y +CONFIG_EAP_MSCHAPV2=y +CONFIG_EAP_PEAP=y +CONFIG_EAP_GTC=y +CONFIG_EAP_TTLS=y +CONFIG_EAP_SIM=y +CONFIG_EAP_AKA=y +CONFIG_EAP_AKA_PRIME=y +CONFIG_EAP_GPSK=y +CONFIG_EAP_GPSK_SHA256=y +CONFIG_EAP_SAKE=y +CONFIG_EAP_PAX=y +CONFIG_EAP_PSK=y +CONFIG_EAP_VENDOR_TEST=y +CONFIG_EAP_FAST=y +CONFIG_EAP_IKEV2=y +CONFIG_EAP_TNC=y +CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\" +LIBS += -rdynamic +CONFIG_EAP_UNAUTH_TLS=y +CONFIG_EAP_EKE=y +CONFIG_PKCS12=y +CONFIG_RADIUS_SERVER=y +CONFIG_IPV6=y +CONFIG_TLSV11=y +CONFIG_TLSV12=y + +CONFIG_FULL_DYNAMIC_VLAN=y +CONFIG_VLAN_NETLINK=y +CONFIG_LIBNL32=y +CONFIG_LIBNL3_ROUTE=y +CONFIG_PEERKEY=y +CONFIG_IEEE80211W=y +CONFIG_IEEE80211R=y +CONFIG_IEEE80211N=y +CONFIG_IEEE80211AC=y + +CONFIG_WPS=y +CONFIG_WPS_UPNP=y +CONFIG_WPS_NFC=y +#CONFIG_WPS_STRICT=y +#CONFIG_WPA_TRACE=y +#CONFIG_WPA_TRACE_BFD=y + +CONFIG_P2P_MANAGER=y +CONFIG_DEBUG_FILE=y +CONFIG_DEBUG_LINUX_TRACING=y +CONFIG_WPA_CLI_EDIT=y +CONFIG_ACS=y +CONFIG_NO_RANDOM_POOL=y +CONFIG_WNM=y +CONFIG_INTERWORKING=y +CONFIG_HS20=y +CONFIG_SQLITE=y +#CONFIG_SAE=y +#CFLAGS += -DALL_DH_GROUPS + +CONFIG_FST=y +CONFIG_FST_TEST=y + +CONFIG_TESTING_OPTIONS=y +CFLAGS += -DCONFIG_RADIUS_TEST +CONFIG_MODULE_TESTS=y + +CONFIG_SUITEB=y + +CONFIG_MBO=y + +CONFIG_CODE_COVERAGE=y +CFLAGS += -O0 -Wsign-compare + +CONFIG_IAPP=y +CONFIG_TAXONOMY=y +#CONFIG_FILS=y +#CONFIG_FILS_SK_PFS=y +#CONFIG_OWE=y +#CONFIG_DPP=y diff --git a/tests/build/build-hostapd-minimal.config b/tests/build/build-hostapd-minimal.config new file mode 100644 index 000000000..bd7e1847c --- /dev/null +++ b/tests/build/build-hostapd-minimal.config @@ -0,0 +1,17 @@ +CONFIG_NO_STDOUT_DEBUG=y + +CONFIG_NO_RADIUS=y +#CONFIG_NO_ACCOUNTING=y + +CONFIG_NO_VLAN=y +CONFIG_NO_CTRL_IFACE=y + +CFLAGS += -Werror + +CFLAGS += -DCONFIG_NO_HOSTAPD_LOGGER + +CONFIG_NO_AES_EXTRAS=y + +CFLAGS += -Os + +CONFIG_IEEE80211N=y diff --git a/tests/build/build-hostapd.sh b/tests/build/build-hostapd.sh new file mode 100755 index 000000000..3f431c96a --- /dev/null +++ b/tests/build/build-hostapd.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +DIR=$1 +CONF=$2 +if [ -z "$DIR" -o -z "$CONF" ]; then + echo "usage: $0 " + exit 1 +fi +if [ ! -d "$DIR" ]; then + echo "DIR does not exist: $DIR" + exit 1 +fi +if [ ! -r "$CONF" ]; then + echo "CONF does not exist: $CONF" + exit 1 +fi + +NAME=`echo $CONF | sed s/^build-hostapd-// | sed s/\.config$//` +echo -n "hostapd build: $NAME - " + +pushd $DIR > /dev/null +rm -rf hostap-build +tar xf hostap-build.tar +popd > /dev/null +cp $CONF $DIR/hostap-build/hostapd/.config + +pushd $DIR/hostap-build/hostapd > /dev/null +if make -j8 > $DIR/hostapd-$NAME.log 2>&1; then + mv $DIR/hostapd-$NAME.log{,-OK} + echo OK +else + mv $DIR/hostapd-$NAME.log{,-FAIL} + echo FAIL +fi +rm -rf $DIR/hostap-build +popd > /dev/null diff --git a/tests/build/build-wpa_supplicant-basic.config b/tests/build/build-wpa_supplicant-basic.config new file mode 100644 index 000000000..f1373d840 --- /dev/null +++ b/tests/build/build-wpa_supplicant-basic.config @@ -0,0 +1,7 @@ +CFLAGS += -Werror +CONFIG_WPS=y +CONFIG_WPS2=y +CONFIG_EAP_TLS=y +CONFIG_EAP_MSCHAPV2=y +CONFIG_EAP_PSK=y +CONFIG_EAP_FAST=y diff --git a/tests/build/build-wpa_supplicant-dbus_without_ap.config b/tests/build/build-wpa_supplicant-dbus_without_ap.config new file mode 100644 index 000000000..08d0e8922 --- /dev/null +++ b/tests/build/build-wpa_supplicant-dbus_without_ap.config @@ -0,0 +1,2 @@ +CFLAGS += -Werror +CONFIG_CTRL_IFACE_DBUS_NEW=y diff --git a/tests/build/build-wpa_supplicant-empty.config b/tests/build/build-wpa_supplicant-empty.config new file mode 100644 index 000000000..f5effe207 --- /dev/null +++ b/tests/build/build-wpa_supplicant-empty.config @@ -0,0 +1 @@ +CFLAGS += -Werror diff --git a/tests/build/build-wpa_supplicant-gnutls.config b/tests/build/build-wpa_supplicant-gnutls.config new file mode 100644 index 000000000..8aa0611b8 --- /dev/null +++ b/tests/build/build-wpa_supplicant-gnutls.config @@ -0,0 +1,17 @@ +CONFIG_TLS=gnutls + +CONFIG_WPS=y +CONFIG_EAP_TLS=y +CONFIG_EAP_MSCHAPV2=y + +CONFIG_EAP_PSK=y +CONFIG_EAP_GPSK=y +CONFIG_EAP_AKA=y +CONFIG_EAP_SIM=y +CONFIG_EAP_SAKE=y +CONFIG_EAP_PAX=y +CONFIG_EAP_FAST=y +CONFIG_EAP_IKEV2=y + +CONFIG_IEEE80211W=y +CFLAGS += -Werror diff --git a/tests/build/build-wpa_supplicant-internal.config b/tests/build/build-wpa_supplicant-internal.config new file mode 100644 index 000000000..4ddf3399c --- /dev/null +++ b/tests/build/build-wpa_supplicant-internal.config @@ -0,0 +1,129 @@ +CFLAGS += -Werror + +CONFIG_TLS=internal +CONFIG_INTERNAL_LIBTOMMATH=y +CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +CONFIG_IEEE8021X_EAPOL=y + +CONFIG_ERP=y +CONFIG_EAP_MD5=y +CONFIG_MSCHAPV2=y +CONFIG_EAP_TLS=y +CONFIG_EAP_PEAP=y +CONFIG_EAP_TTLS=y +CONFIG_EAP_GTC=y +CONFIG_EAP_OTP=y +CONFIG_EAP_PSK=y +CONFIG_EAP_PAX=y +CONFIG_EAP_LEAP=y +CONFIG_EAP_SIM=y +CONFIG_EAP_AKA=y +CONFIG_EAP_AKA_PRIME=y +CONFIG_EAP_VENDOR_TEST=y +CONFIG_EAP_TLV=y +CONFIG_EAP_SAKE=y +CONFIG_EAP_GPSK=y +CONFIG_EAP_GPSK_SHA256=y +CONFIG_EAP_EKE=y +CONFIG_EAP_TNC=y +CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\" +LIBS += -rdynamic +CONFIG_EAP_FAST=y +CONFIG_EAP_IKEV2=y + +CONFIG_IPV6=y +CONFIG_DRIVER_NONE=y +CONFIG_PKCS12=y +CONFIG_CTRL_IFACE=unix + +CONFIG_WPA_CLI_EDIT=y + +CONFIG_OCSP=y + +#CONFIG_ELOOP_POLL=y + +#CONFIG_CTRL_IFACE_DBUS=y +#CONFIG_CTRL_IFACE_DBUS_NEW=y +#CONFIG_CTRL_IFACE_DBUS_INTRO=y + +CONFIG_PEERKEY=y +CONFIG_IEEE80211W=y +CONFIG_IEEE80211R=y +CONFIG_IEEE80211N=y +CONFIG_IEEE80211AC=y + +CONFIG_DEBUG_FILE=y + +CONFIG_WPS=y +#CONFIG_WPS_STRICT=y +CONFIG_WPS_UPNP=y +CONFIG_WPS_NFC=y +CONFIG_WPS_ER=y +#CONFIG_WPS_REG_DISABLE_OPEN=y + +CONFIG_DRIVER_WEXT=y + +CONFIG_DRIVER_NL80211=y +CFLAGS += -I/usr/include/libnl3 +CONFIG_LIBNL32=y + +CONFIG_IBSS_RSN=y + +CONFIG_AP=y +#CONFIG_MESH=y +CONFIG_P2P=y +CONFIG_WIFI_DISPLAY=y + +CONFIG_ACS=y + +CONFIG_BGSCAN_SIMPLE=y +CONFIG_BGSCAN_LEARN=y + +#CONFIG_WPA_TRACE=y +#CONFIG_WPA_TRACE_BFD=y + +CONFIG_TDLS=y +#CONFIG_TDLS_TESTING=y +CONFIG_NO_RANDOM_POOL=y + +CONFIG_TLSV11=y +CONFIG_TLSV12=y + +#CONFIG_HT_OVERRIDES=y +#CONFIG_VHT_OVERRIDES=y + +#CONFIG_DEBUG_LINUX_TRACING=y + +CONFIG_INTERWORKING=y +CONFIG_HS20=y + +CONFIG_AUTOSCAN_EXPONENTIAL=y +CONFIG_AUTOSCAN_PERIODIC=y + +CONFIG_EXT_PASSWORD_TEST=y + +CONFIG_EAP_UNAUTH_TLS=y + +#CONFIG_SAE=y +#CFLAGS += -DALL_DH_GROUPS + +CONFIG_WNM=y + +CONFIG_FST=y +#CONFIG_FST_TEST=y + +#CONFIG_TESTING_OPTIONS=y +#CONFIG_MODULE_TESTS=y + +CONFIG_SUITEB=y + +CONFIG_MBO=y + +#CONFIG_CODE_COVERAGE=y +CFLAGS += -O0 -Wsign-compare +#CONFIG_FILS=y +#CONFIG_FILS_SK_PFS=y +CONFIG_PMKSA_CACHE_EXTERNAL=y +#CONFIG_OWE=y +#CONFIG_DPP=y diff --git a/tests/build/build-wpa_supplicant-p2p.config b/tests/build/build-wpa_supplicant-p2p.config new file mode 100644 index 000000000..892734617 --- /dev/null +++ b/tests/build/build-wpa_supplicant-p2p.config @@ -0,0 +1,8 @@ +CONFIG_DRIVER_NL80211=y +CONFIG_CTRL_IFACE=y +CONFIG_WPS=y +CONFIG_P2P=y +CONFIG_WPS2=y +CONFIG_AP=y +CFLAGS += -Werror +CONFIG_LIBNL32=y diff --git a/tests/build/build-wpa_supplicant.sh b/tests/build/build-wpa_supplicant.sh new file mode 100755 index 000000000..cf1caee51 --- /dev/null +++ b/tests/build/build-wpa_supplicant.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +DIR=$1 +CONF=$2 +if [ -z "$DIR" -o -z "$CONF" ]; then + echo "usage: $0 " + exit 1 +fi +if [ ! -d "$DIR" ]; then + echo "DIR does not exist: $DIR" + exit 1 +fi +if [ ! -r "$CONF" ]; then + echo "CONF does not exist: $CONF" + exit 1 +fi + +NAME=`echo $CONF | sed s/^build-wpa_supplicant-// | sed s/\.config$//` +echo -n "wpa_supplicant build: $NAME - " + +pushd $DIR > /dev/null +rm -rf hostap-build +tar xf hostap-build.tar +popd > /dev/null +cp $CONF $DIR/hostap-build/wpa_supplicant/.config + +pushd $DIR/hostap-build/wpa_supplicant > /dev/null +if make -j8 > $DIR/wpa_supplicant-$NAME.log 2>&1; then + mv $DIR/wpa_supplicant-$NAME.log{,-OK} + echo OK +else + mv $DIR/wpa_supplicant-$NAME.log{,-FAIL} + echo FAIL +fi +rm -rf $DIR/hostap-build +popd > /dev/null diff --git a/tests/build/run-build-tests.sh b/tests/build/run-build-tests.sh new file mode 100755 index 000000000..347ca39a0 --- /dev/null +++ b/tests/build/run-build-tests.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +DIR=`mktemp -d` +pushd ../.. > /dev/null +git archive --format=tar --prefix=hostap-build/ HEAD > $DIR/hostap-build.tar +popd > /dev/null + +echo "Build test directory: $DIR" +echo + +for i in build-hostapd-*.config; do + ./build-hostapd.sh $DIR $i +done + +for i in build-wpa_supplicant-*.config; do + ./build-wpa_supplicant.sh $DIR $i +done + +echo +echo "Build test directory: $DIR"