summaryrefslogtreecommitdiff
path: root/test/navigation/script/test-poi-guidance.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/navigation/script/test-poi-guidance.py')
-rwxr-xr-xtest/navigation/script/test-poi-guidance.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/test/navigation/script/test-poi-guidance.py b/test/navigation/script/test-poi-guidance.py
index 356592a..0e79818 100755
--- a/test/navigation/script/test-poi-guidance.py
+++ b/test/navigation/script/test-poi-guidance.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/route/guidance"
@@ -213,7 +218,7 @@ def timeout():
def exit(value):
global g_exit
g_exit=value
- if dltTrigger==True:
+ if dltAvailable==True:
stopTrigger(test_name)
loop.quit()
@@ -262,7 +267,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')
@@ -320,8 +327,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(routing_routeCalculationProgressUpdate_handler, \
dbus_interface = "org.genivi.navigation.navigationcore.Routing", \
@@ -371,7 +381,7 @@ bus.add_signal_receiver(poi_resultListChanged_signal_handler, \
dbus_interface = "org.genivi.navigation.poiservice.POISearch", \
signal_name = "ResultListChanged")
-if dltTrigger==True:
+if dltAvailable==True:
startTrigger(test_name)
navigationcore_session_obj = bus.get_object('org.genivi.navigation.navigationcore.Session','/org/genivi/navigationcore')