summaryrefslogtreecommitdiff
path: root/test/test-supplicant
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-03-12 14:53:14 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-03-12 14:53:14 +0100
commit7294e829c825e0f7b56b4fdb83dbc2939c33ca71 (patch)
tree1e1b764f65c6d73e59d88b03434553c0fcb95382 /test/test-supplicant
parent451d80c342f0ed95363b7056221544207323bbaa (diff)
downloadconnman-7294e829c825e0f7b56b4fdb83dbc2939c33ca71.tar.gz
connman-7294e829c825e0f7b56b4fdb83dbc2939c33ca71.tar.bz2
connman-7294e829c825e0f7b56b4fdb83dbc2939c33ca71.zip
Add simple test script for D-Bus supplicant
Diffstat (limited to 'test/test-supplicant')
-rwxr-xr-xtest/test-supplicant59
1 files changed, 59 insertions, 0 deletions
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])