test: Cannot set both name and passphrase
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Fri, 20 Apr 2012 10:57:03 +0000 (13:57 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 20 Apr 2012 11:25:11 +0000 (13:25 +0200)
simple-agent could not be used to return both the Name and Passphrase
fields for hidden psk networks.

Fixes BMC#25058

test/simple-agent

index dac1fed..7b0f5aa 100755 (executable)
@@ -102,16 +102,14 @@ class Agent(dbus.service.Object):
        def RequestInput(self, path, fields):
                print "RequestInput (%s,%s)" % (path, fields)
 
-               response = None
+               response = {}
 
                if fields.has_key("Name"):
-                       response = self.input_hidden()
-               elif fields.has_key("Passphrase"):
-                       response = self.input_passphrase()
-               elif fields.has_key("Username"):
-                       response = self.input_username()
-               else:
-                       print "No method to answer the input request"
+                       response.update(self.input_hidden())
+               if fields.has_key("Passphrase"):
+                       response.update(self.input_passphrase())
+               if fields.has_key("Username"):
+                       response.update(self.input_username())
 
                print "returning (%s)" % (response)