From 731e60f5c58b404bbedb4294aa37f7fbc652d500 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 2 Mar 2013 11:39:54 +0200 Subject: [PATCH] tests: Add start/stop scripts and configuration files Signed-hostap: Jouni Malinen --- tests/hwsim/p2p0.conf | 3 +++ tests/hwsim/p2p1.conf | 3 +++ tests/hwsim/p2p2.conf | 3 +++ tests/hwsim/start-p2p.sh | 13 +++++++++++++ tests/hwsim/stop-wifi.sh | 7 +++++++ 5 files changed, 29 insertions(+) create mode 100644 tests/hwsim/p2p0.conf create mode 100644 tests/hwsim/p2p1.conf create mode 100644 tests/hwsim/p2p2.conf create mode 100755 tests/hwsim/start-p2p.sh create mode 100755 tests/hwsim/stop-wifi.sh diff --git a/tests/hwsim/p2p0.conf b/tests/hwsim/p2p0.conf new file mode 100644 index 000000000..9482bdca4 --- /dev/null +++ b/tests/hwsim/p2p0.conf @@ -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 index 000000000..3622b1523 --- /dev/null +++ b/tests/hwsim/p2p1.conf @@ -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 index 000000000..eda52e13b --- /dev/null +++ b/tests/hwsim/p2p2.conf @@ -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 index 000000000..2000677ed --- /dev/null +++ b/tests/hwsim/start-p2p.sh @@ -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 index 000000000..d5d93ecfc --- /dev/null +++ b/tests/hwsim/stop-wifi.sh @@ -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