diff options
Diffstat (limited to 'test/navigation/script/test-poi.py')
-rwxr-xr-x | test/navigation/script/test-poi.py | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/test/navigation/script/test-poi.py b/test/navigation/script/test-poi.py index 23ad67e..77f3727 100755 --- a/test/navigation/script/test-poi.py +++ b/test/navigation/script/test-poi.py @@ -32,15 +32,20 @@ import xml.dom.minidom import argparse import sys import os.path +import commands 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 = "poi search" @@ -122,7 +127,7 @@ def timeout(): def exit(value): global g_exit g_exit=value - if dltTrigger==True: + if dltAvailable==True: stopTrigger(test_name) loop.quit() @@ -136,7 +141,9 @@ g_exit=0 parser = argparse.ArgumentParser(description='Poi Test for navigation PoC and FSA.') parser.add_argument('-l','--loc',action='store', dest='locations', help='List of locations in xml format') -parser.add_argument("-v", "--verbose", action='store_true',help='print the whole log messages') +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') parser.add_argument('-s','--string',action='store', dest='string', help='String to search') parser.add_argument('-r','--radius',action='store', dest='radius', help='Search radius in tenth of meters') parser.add_argument('-w','--window',action='store', dest='window', help='Max number of requested results') @@ -196,8 +203,11 @@ if __name__ == '__main__': print("Search for hotel and restaurant with keyword: "+ stringToSearch) -#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_poi_configurationChanged_signal_handler, \ dbus_interface = "org.genivi.navigation.poiservice.POIConfiguration", \ @@ -211,7 +221,7 @@ bus.add_signal_receiver(catch_poi_resultListChanged_signal_handler, \ dbus_interface = "org.genivi.navigation.poiservice.POISearch", \ signal_name = "ResultListChanged") -if dltTrigger==True: +if dltAvailable==True: startTrigger(test_name) poiConfiguration = bus.get_object('org.genivi.navigation.poiservice.POIConfiguration','/org/genivi/poiservice/POIConfiguration') |