Search Linux Wireless

[PATCH] wifi-test: add simple roam test script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds a simple roam test script. It uses the supplicant
wpa_cli utility to interact with your existing session.
You can either use Network Manager and connect to an ESS
or use wpa_supplicant manually and connect to an ESS, in
both cases you need to hand pick an ESS by SSID and support
the control interface of the supplicant. The script will just
force a roam onto all the APs on the ESS in round robin,
sleeping 2 seconds between each roam. If you are not testing
signal drops you can use this to move around APs without
walking around a building.

Cc: Paul Stewart <pstew@xxxxxxxxxx>
Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---

The wifi-test.git tree is down right now.. so if you want to test
this you can download the script from:

http://bombadil.infradead.org/~mcgrof/test-roam

for now. This script let me find a bug, I'll post the oops
shortly.

 simple/test-roam |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100755 simple/test-roam

diff --git a/simple/test-roam b/simple/test-roam
new file mode 100755
index 0000000..9d1c0c4
--- /dev/null
+++ b/simple/test-roam
@@ -0,0 +1,66 @@
+#!/bin/bash
+# Copyright (c) 2010 Luis R. Rodriguez <mcgrof@xxxxxxxxx>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING O
+
+# Pretty colors
+GREEN="\033[01;32m"
+YELLOW="\033[01;33m"
+NORMAL="\033[00m"
+BLUE="\033[34m"
+RED="\033[31m"
+PURPLE="\033[35m"
+CYAN="\033[36m"
+
+if [ $# -ne 1 ]; then
+	echo -e "Usage: $0 <SSID>"
+	exit
+fi
+
+SSID="$1"
+
+# assumes you have a control interface exposed,
+# If you want to use this with network-manager ensure
+# you modify your dbus settings for wpa_supplicant. This is
+# documented here:
+#
+# http://wireless.kernel.org/en/users/Documentation/wpa_supplicant#Enabling_control_interface_and_nl80211_driver
+
+echo -e "${CYAN}Issuing first scan...${NORMAL}"
+
+# XXX: add 'iw event <event-type> -c 1' support
+sudo wpa_cli scan
+
+echo -e "${CYAN}Waiting for results...${NORMAL}"
+sleep 5
+
+echo -e "${CYAN}Collecting scan results...${NORMAL}"
+ESS=$(sudo wpa_cli scan_results| grep $SSID | awk '{print $1}')
+COUNT=$(echo $ESS | wc -w)
+
+echo -e "${RED}$COUNT ${NORMAL}APs found on ESS ${GREEN}$SSID${NORMAL}, going to roam between them now"
+echo -e "AP list:${NORMAL}"
+
+echo -e "\t${GREEN}BSS\t\t\t${YELLOW}Freq${NORMAL}"
+for i in $ESS; do
+	FREQ=$(sudo wpa_cli scan_results| grep $i | awk '{print $2}')
+	echo -e "\t${GREEN}$i\t${YELLOW}$FREQ"
+done
+
+while true; do
+	for i in $ESS; do
+		FREQ=$(sudo wpa_cli scan_results| grep $i | awk '{print $2}')
+		echo -e "${NORMAL}Roaming to ${CYAN}${SSID} ${GREEN}${i} ${YELLOW}${FREQ} ${NORMAL}MHz..."
+		sudo wpa_cli roam $i;
+		sleep 2;
+	done;
+done
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux