dnsproxy: Only one copy of the relevant buffers will be made to a TCP request
[framework/connectivity/connman.git] / test / test-supplicant
1 #!/usr/bin/python
2
3 import dbus
4 import time
5
6 WPA_NAME='fi.epitest.hostap.WPASupplicant'
7 WPA_INTF='fi.epitest.hostap.WPASupplicant'
8 WPA_PATH='/fi/epitest/hostap/WPASupplicant'
9
10 bus = dbus.SystemBus()
11
12 dummy = dbus.Interface(bus.get_object(WPA_NAME, WPA_PATH),
13                                 'org.freedesktop.DBus.Introspectable')
14
15 #print dummy.Introspect()
16
17 manager = dbus.Interface(bus.get_object(WPA_NAME, WPA_PATH), WPA_INTF)
18
19 try:
20         path = manager.getInterface("wlan0")
21 except:
22         path = manager.addInterface("wlan0")
23
24 interface = dbus.Interface(bus.get_object(WPA_NAME, path),
25                                         WPA_INTF + ".Interface")
26
27 print "state = %s" % (interface.state())
28
29 try:
30         print "scanning = %s" % (interface.scanning())
31 except:
32         pass
33
34 print "[ %s ]" % (path)
35
36 capabilities = interface.capabilities()
37
38 for key in capabilities.keys():
39         list = ""
40         for value in capabilities[key]:
41                 list += " " + value
42         print "    %s =%s" % (key, list)
43
44 interface.scan()
45
46 time.sleep(1)
47
48 try:
49         print "scanning = %s" % (interface.scanning())
50 except:
51         pass
52
53 time.sleep(1)
54
55 print "state = %s" % (interface.state())
56
57 results = interface.scanResults()
58
59 print results
60
61 path = results[0]
62
63 print "[ %s ]" % (path)
64
65 bssid = dbus.Interface(bus.get_object(WPA_NAME, path),
66                                         WPA_INTF + ".BSSID")
67
68 properties = bssid.properties()
69
70 for key in properties.keys():
71         print "    %s = %s" % (key, properties[key])