summaryrefslogtreecommitdiff
path: root/test/navigation/script/test-route-calculation.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/navigation/script/test-route-calculation.py')
-rwxr-xr-xtest/navigation/script/test-route-calculation.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/test/navigation/script/test-route-calculation.py b/test/navigation/script/test-route-calculation.py
index 336dca3..ced6099 100755
--- a/test/navigation/script/test-route-calculation.py
+++ b/test/navigation/script/test-route-calculation.py
@@ -35,15 +35,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 = "route calculation"
@@ -58,6 +63,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:
@@ -89,8 +97,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()
#add signal receivers
def catchall_route_calculation_signals_handler(routeHandle, status, percentage):
@@ -157,7 +168,7 @@ def timeout():
def exit(value):
global g_exit
g_exit=value
- if dltTrigger==True:
+ if dltAvailable==True:
stopTrigger(test_name)
loop.quit()
@@ -190,7 +201,7 @@ def launch_route_calculation(route):
#calculate route
g_routing_interface.CalculateRoute(dbus.UInt32(g_session_handle),dbus.UInt32(g_route_handle))
-if dltTrigger==True:
+if dltAvailable==True:
startTrigger(test_name)
session = bus.get_object('org.genivi.navigation.navigationcore.Session','/org/genivi/navigationcore')