tests: Add start/stop scripts and configuration files
authorJouni Malinen <j@w1.fi>
Sat, 2 Mar 2013 09:39:54 +0000 (11:39 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 2 Mar 2013 09:39:54 +0000 (11:39 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/p2p0.conf [new file with mode: 0644]
tests/hwsim/p2p1.conf [new file with mode: 0644]
tests/hwsim/p2p2.conf [new file with mode: 0644]
tests/hwsim/start-p2p.sh [new file with mode: 0755]
tests/hwsim/stop-wifi.sh [new file with mode: 0755]

diff --git a/tests/hwsim/p2p0.conf b/tests/hwsim/p2p0.conf
new file mode 100644 (file)
index 0000000..9482bdc
--- /dev/null
@@ -0,0 +1,3 @@
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin
+device_name=Device A
+p2p_no_group_iface=1
diff --git a/tests/hwsim/p2p1.conf b/tests/hwsim/p2p1.conf
new file mode 100644 (file)
index 0000000..3622b15
--- /dev/null
@@ -0,0 +1,3 @@
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin
+device_name=Device B
+p2p_no_group_iface=1
diff --git a/tests/hwsim/p2p2.conf b/tests/hwsim/p2p2.conf
new file mode 100644 (file)
index 0000000..eda52e1
--- /dev/null
@@ -0,0 +1,3 @@
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin
+device_name=Device C
+p2p_no_group_iface=1
diff --git a/tests/hwsim/start-p2p.sh b/tests/hwsim/start-p2p.sh
new file mode 100755 (executable)
index 0000000..2000677
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+DIR="$( cd "$( dirname "$0" )" && pwd )"
+WPAS=$DIR/../../wpa_supplicant/wpa_supplicant
+
+$DIR/stop-wifi.sh
+sudo modprobe mac80211_hwsim radios=3
+mkdir -p $DIR/logs
+DATE=`date +%s`
+sudo $WPAS -Dnl80211 -iwlan0 -c $DIR/p2p0.conf -ddKt > $DIR/logs/$DATE-log0 &
+sudo $WPAS -Dnl80211 -iwlan1 -c $DIR/p2p1.conf -ddKt > $DIR/logs/$DATE-log1 &
+sudo $WPAS -Dnl80211 -iwlan2 -c $DIR/p2p2.conf -ddKt > $DIR/logs/$DATE-log2 &
+sleep 1
diff --git a/tests/hwsim/stop-wifi.sh b/tests/hwsim/stop-wifi.sh
new file mode 100755 (executable)
index 0000000..d5d93ec
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+sudo killall -q hostapd
+sudo killall -q wpa_supplicant
+if grep -q mac80211_hwsim /proc/modules ; then
+    sudo rmmod mac80211_hwsim 
+fi