diff options
Diffstat (limited to 'test/navigation/script/test-speech.py')
-rwxr-xr-x | test/navigation/script/test-speech.py | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/test/navigation/script/test-speech.py b/test/navigation/script/test-speech.py index 9eeef43..58174b5 100755 --- a/test/navigation/script/test-speech.py +++ b/test/navigation/script/test-speech.py @@ -27,17 +27,23 @@ import dbus import gobject +import commands +import argparse import dbus.mainloop.glib import genivi try: from dltTrigger import * - dltTrigger=True - print('DLT signal sent') except dltTriggerNotBuilt: - dltTrigger=False + dltAvailable=False +else: + dltAvailable=True #import pdb; pdb.set_trace() +output = commands.getoutput('ps -A') +if not 'dlt' in output: + dltAvailable=False + #name of the test test_name = "speech output" @@ -68,7 +74,7 @@ def timeout(): def exit(value): global g_exit g_exit=value - if dltTrigger==True: + if dltAvailable==True: stopTrigger(test_name) loop.quit() @@ -78,11 +84,20 @@ print('--------------------------\n') g_exit=0 +parser = argparse.ArgumentParser(description='Location input Test for navigation PoC and FSA.') +parser.add_argument("-v", "--verbose", action='store_true',help='Print the whole log messages') +parser.add_argument('-a','--address',action='store', dest='host', help='Set remote host address') +parser.add_argument('-p','--prt',action='store', dest='port', help='Set remote port number') +args = parser.parse_args() + if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) -#connect to session bus -bus = dbus.SessionBus() +# connect to session bus (remote or local) +if args.host != None: + bus = dbus.bus.BusConnection("tcp:host=" + args.host +",port="+args.port) +else: + bus = dbus.SessionBus() bus.add_signal_receiver(catch_speech_notifyConnectionStatus_signal_handler, \ dbus_interface = "org.genivi.hmi.speechservice.SpeechOutput", \ @@ -97,7 +112,7 @@ bus.add_signal_receiver(catch_speech_notifyTTSStatus_signal_handler, \ dbus_interface = "org.genivi.hmi.speechservice.SpeechOutput", \ signal_name = "notifyTTSStatus") -if dltTrigger==True: +if dltAvailable==True: startTrigger(test_name) speech = bus.get_object('org.genivi.hmi.speechservice.SpeechOutput','/org/genivi/hmi/speechservice/SpeechOutput') |