[PATCH 01/14] tests: Add channels argument to run-all.sh and start.sh

Ilan Peer ilan.peer
Tue Jun 10 10:50:29 PDT 2014


From: Haim Dreyfuss <haim.dreyfuss at intel.com>

Add an option to run-all.sh and start.sh to get as an argument the
number of concurrent channels that mac80211_hwsim will be loaded with.
To start mac80211_hwsim with more than one channel, the following
parameter should be added to command line: channels=<num_channels>
The default is one channel (no concurrent channels).
The driver should be loaded with multi channel support in order to run
some tests.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss at intel.com>
---
 tests/hwsim/README     |    8 ++++++++
 tests/hwsim/run-all.sh |    9 ++++++++-
 tests/hwsim/start.sh   |   11 ++++++++++-
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/tests/hwsim/README b/tests/hwsim/README
index 734ed9f..b31deb4 100644
--- a/tests/hwsim/README
+++ b/tests/hwsim/README
@@ -146,6 +146,9 @@ conditions:
 # run normal test cases with Linux tracing
 ./run-all.sh trace
 
+# run normal test cases with multi channel support (see details below)
+./run-all.sh channels=<num of channels>
+
 run-all.sh directs debug logs into the logs subdirectory (or $LOGDIR if
 present in the environment). Log file names include the current UNIX
 timestamp and a postfix to identify the specific log:
@@ -170,6 +173,11 @@ used to specify that all test cases from a single file are to be
 run. Test name as the last command line argument can be specified that a
 single test case is to be run (e.g., "./run-tests.py ap_pmf_required").
 
+Notice that some tests require the driver to support concurrent operation on
+multi channels in order to run. These tests will be skipped in case the driver
+does not support multi channels.
+To enable support for multi channel, the number of channel supported should be
+passed as an argument to run-all.sh or start.sh
 
 Adding/modifying test cases
 ---------------------------
diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh
index 9b556a3..2598557 100755
--- a/tests/hwsim/run-all.sh
+++ b/tests/hwsim/run-all.sh
@@ -43,7 +43,14 @@ else
 	unset TRACE_ARGS
 fi
 
-if ! ./start.sh $VALGRIND $TRACE; then
+NUM_CH=$1
+if [ x${NUM_CH%=[0-9]*} = "xchannels" ]; then
+	shift
+else
+	unset NUM_CH
+fi
+
+if ! ./start.sh $VALGRIND $TRACE $NUM_CH; then
 	if ! [ -z "$LOGBASEDIR" ] ; then
 		echo "Could not start test environment" > $LOGDIR/run
 	fi
diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh
index a130ec1..30a7b01 100755
--- a/tests/hwsim/start.sh
+++ b/tests/hwsim/start.sh
@@ -68,7 +68,16 @@ else
 fi
 
 $DIR/stop.sh
-test -f /proc/modules && sudo modprobe mac80211_hwsim radios=6
+
+TMP=$1
+if [ x${TMP%=[0-9]*} = "xchannels" ]; then
+	NUM_CH=${TMP#channels=}
+	shift
+else
+	NUM_CH=1
+fi
+
+test -f /proc/modules && sudo modprobe mac80211_hwsim radios=6 channels=$NUM_CH
 sudo ifconfig hwsim0 up
 sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -dt -L $LOGDIR/hwsim0 &
 for i in 0 1 2; do
-- 
1.7.10.4




More information about the Hostap mailing list