[PATCH 2/3] tests: Increase STAs for mesh tests

Masashi Honma masashi.honma at gmail.com
Tue Feb 28 17:40:56 PST 2017


Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
---
 tests/hwsim/mesh.conf    |  2 ++
 tests/hwsim/run-tests.py | 16 ++++++++++++----
 tests/hwsim/start.sh     | 13 ++++++++++---
 3 files changed, 24 insertions(+), 7 deletions(-)
 create mode 100644 tests/hwsim/mesh.conf

diff --git a/tests/hwsim/mesh.conf b/tests/hwsim/mesh.conf
new file mode 100644
index 0000000..748d2a0
--- /dev/null
+++ b/tests/hwsim/mesh.conf
@@ -0,0 +1,2 @@
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin
+p2p_no_group_iface=1
diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index 80981ba..931a9fd 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -319,10 +319,16 @@ def main():
     log_handler.setFormatter(log_formatter)
     logger.addHandler(log_handler)
 
-    dev0 = WpaSupplicant('wlan0', '/tmp/wpas-wlan0')
-    dev1 = WpaSupplicant('wlan1', '/tmp/wpas-wlan1')
-    dev2 = WpaSupplicant('wlan2', '/tmp/wpas-wlan2')
-    dev = [ dev0, dev1, dev2 ]
+    dev = []
+    # the number of additional stations.
+    # When you will modify, modify ADDITIONAL_STA_NUM in start.sh also.
+    additional_sta_num = 2
+    max_if_num = additional_sta_num + 7
+    for i in range(0, 3):
+        dev.append(WpaSupplicant('wlan' + str(i), '/tmp/wpas-wlan' + str(i)))
+    for i in range(7, max_if_num):
+        dev.append(WpaSupplicant('wlan' + str(i), '/tmp/wpas-wlan' + str(i)))
+
     apdev = [ ]
     apdev.append({"ifname": 'wlan3', "bssid": "02:00:00:00:03:00"})
     apdev.append({"ifname": 'wlan4', "bssid": "02:00:00:00:04:00"})
@@ -493,6 +499,8 @@ def main():
 
             for i in range(0, 3):
                 rename_log(args.logdir, 'log' + str(i), name, dev[i])
+            for i in range(7, max_if_num):
+                rename_log(args.logdir, 'log' + str(i), name, dev[i - 4])
             try:
                 hapd = HostapdGlobal()
             except Exception, e:
diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh
index cee9239..cbd900d 100755
--- a/tests/hwsim/start.sh
+++ b/tests/hwsim/start.sh
@@ -9,6 +9,10 @@ HAPDCLI=$DIR/../../hostapd/hostapd_cli
 WLANTEST=$DIR/../../wlantest/wlantest
 HLR_AUC_GW=$DIR/../../hostapd/hlr_auc_gw
 DATE="$(date +%s)"
+# the number of additional stations.
+# When you will modify, modify additional_sta_num in run-tests.py also.
+ADDITIONAL_STA_NUM=2
+MAX_IF_NUM=`expr $ADDITIONAL_STA_NUM + 7`
 
 if [ -z "$LOGDIR" ] ; then
     LOGDIR="$DIR/logs/$DATE"
@@ -65,6 +69,9 @@ fi
 for i in 0 1 2; do
     sed "s/ GROUP=.*$/ GROUP=$GROUP/" "$DIR/p2p$i.conf" > "$LOGDIR/p2p$i.conf"
 done
+for i in `seq 7 $MAX_IF_NUM`; do
+    sed "s/ GROUP=.*$/ GROUP=$GROUP/" "$DIR/mesh.conf" > "$LOGDIR/p2p$i.conf"
+done
 
 sed "s/group=admin/group=$GROUP/;s%LOGDIR%$LOGDIR%g" "$DIR/auth_serv/as.conf" > "$LOGDIR/as.conf"
 sed "s/group=admin/group=$GROUP/;s%LOGDIR%$LOGDIR%g" "$DIR/auth_serv/as2.conf" > "$LOGDIR/as2.conf"
@@ -101,11 +108,11 @@ else
 	NUM_CH=1
 fi
 
-test -f /proc/modules && sudo modprobe mac80211_hwsim radios=7 channels=$NUM_CH support_p2p_device=0
+test -f /proc/modules && sudo modprobe mac80211_hwsim radios=`expr $MAX_IF_NUM + 1` channels=$NUM_CH support_p2p_device=0
 
 sudo ifconfig hwsim0 up
 sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -dtN -L $LOGDIR/hwsim0 &
-for i in 0 1 2; do
+for i in `seq 0 2` `seq 7 $MAX_IF_NUM`; do
     DBUSARG=""
     if [ $i = "0" -a -r /var/run/dbus/pid -a -r /var/run/dbus/hwsim-test ]; then
 	if $WPAS | grep -q -- -u; then
@@ -194,7 +201,7 @@ for i in 0 1 2 3 4 5 6 7 8 9; do
     fi
     sleep 0.05
 done
-for i in 0 1 2; do
+for i in `seq 0 2` `seq 7 $MAX_IF_NUM`; do
     for j in `seq 1 10`; do
 	if $WPACLI -g /tmp/wpas-wlan$i ping | grep -q PONG; then
 	    break
-- 
2.7.4




More information about the Hostap mailing list