3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

test: Handle missing agent calls in simple-agent

Handle RequestPrivateKeyPassphrase and RequestUserNameAndPassword
This commit is contained in:
Andrew Zaborowski 2020-02-15 01:17:48 +01:00 committed by Denis Kenzior
parent 0b34371253
commit 58737e02d5

View File

@ -35,6 +35,41 @@ class Agent(dbus.service.Object):
print("returning (%s)" % (passphrase))
return passphrase
@dbus.service.method("net.connman.iwd.Agent",
in_signature='o',
out_signature='s')
def RequestPrivateKeyPassphrase(self, path):
print("RequestPrivateKeyPassphrase (%s)" % (path))
print("Service credentials requested, type cancel to cancel")
passphrase = input('Answer: ')
if not passphrase or passphrase == 'cancel':
raise Canceled("canceled")
print("returning (%s)" % (passphrase))
return passphrase
@dbus.service.method("net.connman.iwd.Agent",
in_signature='o',
out_signature='ss')
def RequestUserNameAndPassword(self, path):
print("RequestPrivateKeyPassphrase (%s)" % (path))
print("Service credentials requested, type cancel to cancel")
user = input('User name: ')
if not user or user == 'cancel':
raise Canceled("canceled")
passwd = input('User password: ')
if not passwd or passwd == 'cancel':
raise Canceled("canceled")
print("returning (%s, %s)" % (user, passwd))
return (user, passwd)
@dbus.service.method("net.connman.iwd.Agent",
in_signature='s', out_signature='')
def Cancel(self, reason):