diff options
Diffstat (limited to 'test/navigation/script/test-guidance.py')
-rwxr-xr-x | test/navigation/script/test-guidance.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/test/navigation/script/test-guidance.py b/test/navigation/script/test-guidance.py index 7eb7a4d..9bccd7d 100755 --- a/test/navigation/script/test-guidance.py +++ b/test/navigation/script/test-guidance.py @@ -34,16 +34,21 @@ import xml.dom.minidom import argparse import sys import os.path +import commands import time 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 = "guidance/map viewer" @@ -168,7 +173,7 @@ def exit(value): global g_exit g_exit=value #deleteMapView() - if dltTrigger==True: + if dltAvailable==True: stopTrigger(test_name) loop.quit() @@ -281,6 +286,9 @@ g_exit=0 parser = argparse.ArgumentParser(description='Route Calculation Test for navigation PoC and FSA.') parser.add_argument('-r','--rou',action='store', dest='routes', help='List of routes in xml format') +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 args.routes == None: @@ -312,8 +320,11 @@ for location in route_set.getElementsByTagName("location"): 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(routing_routeCalculationProgressUpdate_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Routing", \ @@ -351,7 +362,7 @@ bus.add_signal_receiver(mapmatchedposition_simulationStatusChanged_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.MapMatchedPosition", \ signal_name = "SimulationStatusChanged") -if dltTrigger==True: +if dltAvailable==True: startTrigger(test_name) navigationcore_session_obj = bus.get_object('org.genivi.navigation.navigationcore.Session','/org/genivi/navigationcore') |