2013-03-19 09:58:28 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
DIR="$( cd "$( dirname "$0" )" && pwd )"
|
|
|
|
WPAS=$DIR/../../wpa_supplicant/wpa_supplicant
|
2013-08-24 18:01:32 +02:00
|
|
|
HAPD=$DIR/../../hostapd/hostapd
|
2013-03-19 09:58:28 +01:00
|
|
|
WLANTEST=$DIR/../../wlantest/wlantest
|
|
|
|
|
2013-08-24 19:33:21 +02:00
|
|
|
if [ "x$1" = "xvalgrind" ]; then
|
|
|
|
VALGRIND=y
|
|
|
|
else
|
|
|
|
unset VALGRIND
|
|
|
|
fi
|
|
|
|
|
2013-03-19 09:58:28 +01:00
|
|
|
$DIR/stop-wifi.sh
|
2013-08-24 18:01:32 +02:00
|
|
|
sudo modprobe mac80211_hwsim radios=5
|
2013-03-19 09:58:28 +01:00
|
|
|
sudo iw wlan0 interface add sta0 type station
|
|
|
|
sudo iw wlan1 interface add sta1 type station
|
|
|
|
sudo iw wlan2 interface add sta2 type station
|
|
|
|
mkdir -p $DIR/logs
|
|
|
|
DATE=`date +%s`
|
|
|
|
sudo ifconfig hwsim0 up
|
|
|
|
sudo $WLANTEST -i hwsim0 -c -d > $DIR/logs/$DATE-hwsim0 &
|
2013-08-24 18:01:32 +02:00
|
|
|
sudo tcpdump -ni hwsim0 -s 2500 -w $DIR/logs/$DATE-hwsim0.dump &
|
2013-08-24 19:33:21 +02:00
|
|
|
if [ "x$VALGRIND" = "xy" ]; then
|
|
|
|
for i in 0 1 2; do
|
|
|
|
sudo valgrind --log-file=$DIR/logs/$DATE-valgrind-wlan$i $WPAS -g /tmp/wpas-wlan$i -Gadmin -Dnl80211 -iwlan$i -c $DIR/p2p$i.conf -N -Dnl80211 -ista$i -c $DIR/sta-dummy.conf -ddKt > $DIR/logs/$DATE-log$i &
|
|
|
|
done
|
|
|
|
sudo valgrind --log-file=$DIR/logs/$DATE-valgrind-hostapd $HAPD -ddKt -g /var/run/hostapd-global -G admin -ddKt > $DIR/logs/$DATE-hostapd &
|
|
|
|
else
|
|
|
|
for i in 0 1 2; do
|
|
|
|
sudo $WPAS -g /tmp/wpas-wlan$i -Gadmin -Dnl80211 -iwlan$i -c $DIR/p2p$i.conf -N -Dnl80211 -ista$i -c $DIR/sta-dummy.conf -ddKt > $DIR/logs/$DATE-log$i &
|
|
|
|
done
|
|
|
|
sudo $HAPD -ddKt -g /var/run/hostapd-global -G admin -ddKt > $DIR/logs/$DATE-hostapd &
|
|
|
|
fi
|
2013-03-19 09:58:28 +01:00
|
|
|
sleep 1
|
2013-08-24 18:01:32 +02:00
|
|
|
sudo chown $USER $DIR/logs/$DATE-hwsim0.dump
|
2013-08-24 19:33:21 +02:00
|
|
|
if [ "x$VALGRIND" = "xy" ]; then
|
|
|
|
sudo chown $USER $DIR/logs/$DATE-valgrind*
|
2013-08-24 22:47:40 +02:00
|
|
|
sleep 10
|
2013-08-24 19:33:21 +02:00
|
|
|
fi
|