summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Makefile.am3
-rwxr-xr-xtest/test-supplicant59
2 files changed, 61 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index f3ae1831..02760295 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,5 @@
-EXTRA_DIST = list-interfaces start-scanning simple-agent show-introspection
+EXTRA_DIST = list-interfaces start-scanning simple-agent \
+ show-introspection test-supplicant
MAINTAINERCLEANFILES = Makefile.in
diff --git a/test/test-supplicant b/test/test-supplicant
new file mode 100755
index 00000000..e79228dd
--- /dev/null
+++ b/test/test-supplicant
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+import dbus
+import time
+
+WPA_NAME='fi.epitest.hostap.WPASupplicant'
+WPA_INTF='fi.epitest.hostap.WPASupplicant'
+WPA_PATH='/fi/epitest/hostap/WPASupplicant'
+
+bus = dbus.SystemBus()
+
+dummy = dbus.Interface(bus.get_object(WPA_NAME, WPA_PATH),
+ 'org.freedesktop.DBus.Introspectable')
+
+#print dummy.Introspect()
+
+manager = dbus.Interface(bus.get_object(WPA_NAME, WPA_PATH), WPA_INTF)
+
+try:
+ path = manager.getInterface("wlan0")
+except:
+ path = manager.addInterface("wlan0")
+
+interface = dbus.Interface(bus.get_object(WPA_NAME, path),
+ WPA_INTF + ".Interface")
+
+print interface.state()
+
+print interface.scan()
+
+print "[ %s ]" % (path)
+
+capabilities = interface.capabilities()
+
+for key in capabilities.keys():
+ list = ""
+ for value in capabilities[key]:
+ list += " " + value
+ print " %s =%s" % (key, list)
+
+time.sleep(2)
+
+print interface.state()
+
+results = interface.scanResults()
+
+print results
+
+path = results[0]
+
+print "[ %s ]" % (path)
+
+bssid = dbus.Interface(bus.get_object(WPA_NAME, path),
+ WPA_INTF + ".BSSID")
+
+properties = bssid.properties()
+
+for key in properties.keys():
+ print " %s = %s" % (key, properties[key])