diff options
author | asanoaozora <fifitaneki@hotmail.com> | 2017-02-07 14:19:49 +0100 |
---|---|---|
committer | asanoaozora <fifitaneki@hotmail.com> | 2017-02-07 14:19:49 +0100 |
commit | 77e7146c09b9c01f6bf4f27527a47f502a0dea02 (patch) | |
tree | 18d7f352c6f6e0e2bec0867ee2c3b200866aeffa /test | |
parent | 07673f15b00e563d3c9197c0fa5da6ccad26e079 (diff) | |
download | poi-service-77e7146c09b9c01f6bf4f27527a47f502a0dea02.tar.gz |
add a DLT trigger to the test scripts
Diffstat (limited to 'test')
-rw-r--r-- | test/navigation/README.md | 12 | ||||
-rw-r--r-- | test/navigation/dlt-triggers/CMakeLists.txt | 47 | ||||
-rw-r--r-- | test/navigation/dlt-triggers/navigation.dlf | 111 | ||||
-rw-r--r-- | test/navigation/dlt-triggers/test-trigger.c | 58 | ||||
-rw-r--r-- | test/navigation/dltTrigger.py | 42 | ||||
-rwxr-xr-x | test/navigation/test-address-input-capi.py | 5 | ||||
-rwxr-xr-x | test/navigation/test-address-input.py | 24 | ||||
-rwxr-xr-x | test/navigation/test-guidance-capi.py | 13 | ||||
-rwxr-xr-x | test/navigation/test-guidance.py | 15 | ||||
-rwxr-xr-x | test/navigation/test-location-input-capi.py | 6 | ||||
-rwxr-xr-x | test/navigation/test-location-input.py | 30 | ||||
-rwxr-xr-x | test/navigation/test-map-viewer-control-capi.py | 15 | ||||
-rwxr-xr-x | test/navigation/test-map-viewer-control.py | 14 | ||||
-rwxr-xr-x | test/navigation/test-poi.py | 13 | ||||
-rwxr-xr-x | test/navigation/test-route-calculation-capi.py | 18 | ||||
-rwxr-xr-x | test/navigation/test-route-calculation.py | 16 |
16 files changed, 402 insertions, 37 deletions
diff --git a/test/navigation/README.md b/test/navigation/README.md index 405b9f6..ae90708 100644 --- a/test/navigation/README.md +++ b/test/navigation/README.md @@ -10,6 +10,18 @@ test-route-calculation.py test-all and others (*-capi.py) are for the CommonAPI version NB: For the time being, only the GlibDBus version of navigation runs well + +There's a mechanism to trig with DLT, so it's necessary to build some stuff before. + +##How to build the trigger +Under ./dlt-triggers +``` +mkdir build +cd build +cmake ../ +make +make install +``` ##Tested targets Desktop: Tested under Ubuntu 16.04 LTS 64 bits ##How-to test diff --git a/test/navigation/dlt-triggers/CMakeLists.txt b/test/navigation/dlt-triggers/CMakeLists.txt new file mode 100644 index 0000000..006fdd6 --- /dev/null +++ b/test/navigation/dlt-triggers/CMakeLists.txt @@ -0,0 +1,47 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: test-trigger +# +# Author: Philippe Colliot +# +# Copyright (C) 2017, PSA GROUPE +# +# License: +# This Source Code Form is subject to the terms of the +# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# @licence end@ +########################################################################### + +cmake_minimum_required( VERSION 2.6 ) +project( test-trigger ) + +# +# find dependency packages +# + +find_package(PkgConfig) +pkg_check_modules(DLT REQUIRED automotive-dlt) + +# +# include directories +# + +include_directories( + ${DLT_INCLUDE_DIRS} +) + +# +# build project +# + +set(SRCS test-trigger.c) +add_executable(test-trigger ${SRCS}) +target_link_libraries(test-trigger ${DLT_LIBRARIES}) +set_target_properties(test-trigger PROPERTIES LINKER_LANGUAGE C) + +install(TARGETS test-trigger + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin) diff --git a/test/navigation/dlt-triggers/navigation.dlf b/test/navigation/dlt-triggers/navigation.dlf new file mode 100644 index 0000000..7aeeaea --- /dev/null +++ b/test/navigation/dlt-triggers/navigation.dlf @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dltfilter> + <filter> + <type>1</type> + <name>HIDE-APP</name> + <ecuid></ecuid> + <applicationid>APP</applicationid> + <contextid></contextid> + <headertext></headertext> + <payloadtext></payloadtext> + <enableregexp_Context>0</enableregexp_Context> + <enableregexp_Header>0</enableregexp_Header> + <enableregexp_Payload>0</enableregexp_Payload> + <ignoreCase_Header>0</ignoreCase_Header> + <ignoreCase_Payload>0</ignoreCase_Payload> + <enablefilter>1</enablefilter> + <enableecuid>0</enableecuid> + <enableapplicationid>1</enableapplicationid> + <enablecontextid>0</enablecontextid> + <enableheadertext>0</enableheadertext> + <enablepayloadtext>0</enablepayloadtext> + <enablectrlmsgs>0</enablectrlmsgs> + <enableLogLevelMin>0</enableLogLevelMin> + <enableLogLevelMax>0</enableLogLevelMax> + <enableMarker>0</enableMarker> + <filterColour>#ffffff</filterColour> + <logLevelMax>0</logLevelMax> + <logLevelMin>0</logLevelMin> + </filter> + <filter> + <type>1</type> + <name>HIDE-DA1</name> + <ecuid></ecuid> + <applicationid>DA1</applicationid> + <contextid></contextid> + <headertext></headertext> + <payloadtext></payloadtext> + <enableregexp_Context>0</enableregexp_Context> + <enableregexp_Header>0</enableregexp_Header> + <enableregexp_Payload>0</enableregexp_Payload> + <ignoreCase_Header>0</ignoreCase_Header> + <ignoreCase_Payload>0</ignoreCase_Payload> + <enablefilter>1</enablefilter> + <enableecuid>0</enableecuid> + <enableapplicationid>1</enableapplicationid> + <enablecontextid>0</enablecontextid> + <enableheadertext>0</enableheadertext> + <enablepayloadtext>0</enablepayloadtext> + <enablectrlmsgs>0</enablectrlmsgs> + <enableLogLevelMin>0</enableLogLevelMin> + <enableLogLevelMax>0</enableLogLevelMax> + <enableMarker>0</enableMarker> + <filterColour>#ffffff</filterColour> + <logLevelMax>0</logLevelMax> + <logLevelMin>0</logLevelMin> + </filter> + <filter> + <type>2</type> + <name>New Filter</name> + <ecuid>ECU1</ecuid> + <applicationid>NAVI</applicationid> + <contextid>TEST</contextid> + <headertext></headertext> + <payloadtext>Start test</payloadtext> + <enableregexp_Context>0</enableregexp_Context> + <enableregexp_Header>0</enableregexp_Header> + <enableregexp_Payload>0</enableregexp_Payload> + <ignoreCase_Header>0</ignoreCase_Header> + <ignoreCase_Payload>0</ignoreCase_Payload> + <enablefilter>1</enablefilter> + <enableecuid>1</enableecuid> + <enableapplicationid>1</enableapplicationid> + <enablecontextid>1</enablecontextid> + <enableheadertext>0</enableheadertext> + <enablepayloadtext>1</enablepayloadtext> + <enablectrlmsgs>0</enablectrlmsgs> + <enableLogLevelMin>0</enableLogLevelMin> + <enableLogLevelMax>0</enableLogLevelMax> + <enableMarker>0</enableMarker> + <filterColour>#00ff00</filterColour> + <logLevelMax>0</logLevelMax> + <logLevelMin>0</logLevelMin> + </filter> + <filter> + <type>2</type> + <name>New Filter</name> + <ecuid>ECU1</ecuid> + <applicationid>NAVI</applicationid> + <contextid>TEST</contextid> + <headertext></headertext> + <payloadtext>Stop test</payloadtext> + <enableregexp_Context>0</enableregexp_Context> + <enableregexp_Header>0</enableregexp_Header> + <enableregexp_Payload>0</enableregexp_Payload> + <ignoreCase_Header>0</ignoreCase_Header> + <ignoreCase_Payload>0</ignoreCase_Payload> + <enablefilter>1</enablefilter> + <enableecuid>1</enableecuid> + <enableapplicationid>1</enableapplicationid> + <enablecontextid>1</enablecontextid> + <enableheadertext>0</enableheadertext> + <enablepayloadtext>1</enablepayloadtext> + <enablectrlmsgs>0</enablectrlmsgs> + <enableLogLevelMin>0</enableLogLevelMin> + <enableLogLevelMax>0</enableLogLevelMax> + <enableMarker>0</enableMarker> + <filterColour>#ff0000</filterColour> + <logLevelMax>0</logLevelMax> + <logLevelMin>0</logLevelMin> + </filter> +</dltfilter> diff --git a/test/navigation/dlt-triggers/test-trigger.c b/test/navigation/dlt-triggers/test-trigger.c new file mode 100644 index 0000000..b42137f --- /dev/null +++ b/test/navigation/dlt-triggers/test-trigger.c @@ -0,0 +1,58 @@ +/** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 2013-2017, PSA GROUPE +* +* \file test-trigger.c +* +* \brief This file is part of the poi proof of concept. +* +* \author Philippe Colliot <philippe.colliot@mpsa.com> +* +* \version 0.1 +* +* This Source Code Form is subject to the terms of the +* Mozilla Public License (MPL), v. 2.0. +* If a copy of the MPL was not distributed with this file, +* You can obtain one at http://mozilla.org/MPL/2.0/. +* +* For further information see http://www.genivi.org/. +* +* List of changes: +* <date>, <name>, <description of change> +* +* @licence end@ +*/ + +#include <stdio.h> /* for printf() and fprintf() */ +#include <stdlib.h> /* for atoi() and exit() */ +#include <string.h> +#include <dlt.h> + +DLT_DECLARE_CONTEXT(con_test); + +int main(int argc , char** argv ) +{ + if (argc !=3) + { + printf("Usage: test-trigger 1 <name of test> --> start test for <name of test>\n"); + printf(" test-trigger 0 <name of test> --> stop test for <name of test>\n"); + return EXIT_FAILURE; + } + + DLT_REGISTER_APP("NAVI","Test script"); + DLT_REGISTER_CONTEXT(con_test,"TEST","Navigation context for testing"); + + if (strcmp(argv[1],"1")==0) + { + DLT_LOG(con_test,DLT_LOG_INFO,DLT_STRING("Start test of "),DLT_STRING(argv[2])); + } + else + { + DLT_LOG(con_test,DLT_LOG_INFO,DLT_STRING("Stop test of "),DLT_STRING(argv[2])); + } + + DLT_UNREGISTER_CONTEXT(con_test); + DLT_UNREGISTER_APP(); +} diff --git a/test/navigation/dltTrigger.py b/test/navigation/dltTrigger.py new file mode 100644 index 0000000..4a11cd8 --- /dev/null +++ b/test/navigation/dltTrigger.py @@ -0,0 +1,42 @@ +#!/usr/bin/python + +""" +************************************************************************** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 201, PSA GROUPE +* +* \file dlt-trigger.py +* +* \brief This script is part of the FSA scenario. +* +* \author Philippe Colliot <philippe.colliot@mpsa.com> +* +* \version 1.0 +* +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +* List of changes: +* +* @licence end@ + +************************************************************************** +""" +import subprocess,os +from subprocess import call + +PATH_TEST_TRIGGER='./dlt-triggers/bin/' + +def startTrigger(name): + FNULL = open(os.devnull,'w') + test_trigger=PATH_TEST_TRIGGER + 'test-trigger' + call([test_trigger, "1", name]) + +def stopTrigger(name): + FNULL = open(os.devnull,'w') + test_trigger=PATH_TEST_TRIGGER + 'test-trigger' + call([test_trigger, "0", name]) + diff --git a/test/navigation/test-address-input-capi.py b/test/navigation/test-address-input-capi.py index cb0a189..0d538e6 100755 --- a/test/navigation/test-address-input-capi.py +++ b/test/navigation/test-address-input-capi.py @@ -36,8 +36,11 @@ import xml.dom.minidom import argparse import sys import errno +from dltTrigger import * #import pdb;pdb.set_trace() +#name of the test +test_name = "address input" # constants as defined in the Navigation API LATITUDE = 0x00a0 @@ -353,6 +356,7 @@ def exit(): print('Delete location input: '+str(int(error))) error=session_interface.deleteSession(dbus.UInt32(session_handle)) print('Delete session: '+str(int(error))) + stopTrigger(test_name) loop.quit() def startSearch(address_index): @@ -372,6 +376,7 @@ def startSearch(address_index): change_selection_criterion(COUNTRY) full_string_search(location_input_handle, target_search_string) +startTrigger(test_name) session = bus.get_object('org.genivi.navigation.navigationcore.Session.v4_0_Session', '/Session') session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.navigationcore.Session.v4_0') diff --git a/test/navigation/test-address-input.py b/test/navigation/test-address-input.py index 32ece96..f561172 100755 --- a/test/navigation/test-address-input.py +++ b/test/navigation/test-address-input.py @@ -36,8 +36,11 @@ import xml.dom.minidom import argparse import sys import errno +from dltTrigger import * #import pdb;pdb.set_trace() +#name of the test +test_name = "address input" # constants as defined in the Navigation API LATITUDE = 0x00a0 @@ -234,16 +237,16 @@ def evaluate_address(address, guidable): print 'TEST PASSED' else: print 'TEST FAILED (wrong address)' - loop.quit() + exit() else: print 'TEST FAILED (non-guidable address)' - loop.quit() + exit() address_index = current_address_index + 1 if address_index < len(COUNTRY_STRING): startSearch(address_index) else: print 'END OF THE TEST' - loop.quit() + exit() # Signal receiver @@ -319,7 +322,7 @@ def search_result_list_handler(handle, total_size, window_offset, window_size, r location_input_interface.SelectEntry(dbus.UInt32(session_handle), dbus.UInt32(handle), dbus.UInt16(0)) else: print '\nTEST FAILED (Unexpected single result list)' - loop.quit() + exit() elif spell_next_character == 1: spell_next_character = 0 spell_search(handle, entered_search_string, target_search_string, available_characters) @@ -343,7 +346,17 @@ bus.add_signal_receiver(content_updated_handler, def timeout(): print 'Timeout Expired' print '\nTEST FAILED\n' + exit() + +# Exit +def exit(): + error=location_input_interface.DeleteLocationInput(dbus.UInt32(session_handle),dbus.UInt32(location_input_handle)) + print('Delete location input: '+str(int(error))) + error=session_interface.DeleteSession(dbus.UInt32(session_handle)) + print('Delete session: '+str(int(error))) + stopTrigger(test_name) loop.quit() + def startSearch(address_index): global found_exact_match @@ -359,7 +372,8 @@ def startSearch(address_index): change_selection_criterion(COUNTRY) full_string_search(location_input_handle, target_search_string) - +startTrigger(test_name) + session = bus.get_object('org.genivi.navigationcore.Session', '/org/genivi/navigationcore') session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigationcore.Session') diff --git a/test/navigation/test-guidance-capi.py b/test/navigation/test-guidance-capi.py index a1efdb2..3e10065 100755 --- a/test/navigation/test-guidance-capi.py +++ b/test/navigation/test-guidance-capi.py @@ -38,12 +38,15 @@ import argparse import sys import errno import time - +from dltTrigger import * #import pdb; #pdb.set_trace() from pip import locations +#name of the test +test_name = "guidance" + #constants as defined in the Navigation API GENIVI_NAVIGATIONCORE_LATITUDE = 0x00a0 GENIVI_NAVIGATIONCORE_LONGITUDE = 0x00a1 @@ -109,7 +112,7 @@ def session_sessionDeleted_handler(sessionHandle): print 'Test PASSED' else: print 'Test FAILED' - loop.quit() + exit() def routing_routeDeleted_handler(routeHandle): print('Route handle deleted: '+str(routeHandle)) @@ -144,6 +147,10 @@ def mapmatchedposition_simulationStatusChanged_handler(simulationStatus): def timeout(): print 'Timeout Expired' print '\nTest FAILED' + exit() + +def exit(): + stopTrigger(test_name) loop.quit() def display_route(route): @@ -295,6 +302,8 @@ bus.add_signal_receiver(mapmatchedposition_simulationStatusChanged_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.MapMatchedPosition.v4_0", \ signal_name = "simulationStatusChanged") +startTrigger(test_name) + navigationcore_session_obj = bus.get_object('org.genivi.navigation.navigationcore.Session.v4_0_Session','/Session') g_navigationcore_session_interface = dbus.Interface(navigationcore_session_obj, dbus_interface='org.genivi.navigation.navigationcore.Session.v4_0') diff --git a/test/navigation/test-guidance.py b/test/navigation/test-guidance.py index 5c6e253..7d8cb90 100755 --- a/test/navigation/test-guidance.py +++ b/test/navigation/test-guidance.py @@ -38,11 +38,14 @@ import argparse import sys import errno import time - +from dltTrigger import * #import pdb;pdb.set_trace() from pip import locations +#name of the test +test_name = "guidance" + #constants as defined in the Navigation API GENIVI_NAVIGATIONCORE_LATITUDE = 0x00a0 GENIVI_NAVIGATIONCORE_LONGITUDE = 0x00a1 @@ -108,7 +111,7 @@ def session_sessionDeleted_handler(sessionHandle): print 'Test PASSED' else: print 'Test FAILED' - loop.quit() + exit() def routing_routeDeleted_handler(routeHandle): print('Route handle deleted: '+str(routeHandle)) @@ -144,8 +147,12 @@ def mapmatchedposition_simulationStatusChanged_handler(simulationStatus): def timeout(): print 'Timeout Expired' print '\nTest FAILED' - loop.quit() + exit() +def exit(): + stopTrigger(test_name) + loop.quit() + def display_route(route): g_mapviewercontrol_interface.DisplayRoute( \ dbus.UInt32(g_mapviewer_sessionhandle), \ @@ -295,6 +302,8 @@ bus.add_signal_receiver(mapmatchedposition_simulationStatusChanged_handler, \ dbus_interface = "org.genivi.navigationcore.MapMatchedPosition", \ signal_name = "SimulationStatusChanged") +startTrigger(test_name) + navigationcore_session_obj = bus.get_object('org.genivi.navigationcore.Session','/org/genivi/navigationcore') g_navigationcore_session_interface = dbus.Interface(navigationcore_session_obj, dbus_interface='org.genivi.navigationcore.Session') diff --git a/test/navigation/test-location-input-capi.py b/test/navigation/test-location-input-capi.py index 091645c..74fd841 100755 --- a/test/navigation/test-location-input-capi.py +++ b/test/navigation/test-location-input-capi.py @@ -36,9 +36,12 @@ import xml.dom.minidom import argparse import sys import errno +from dltTrigger import * #import pdb; #pdb.set_trace() +#name of the test +test_name = "location input" # constants as defined in the Navigation API LATITUDE = 0x00a0 @@ -437,6 +440,7 @@ def exit(): print('Delete location input: '+str(int(error))) error=session_interface.deleteSession(dbus.UInt32(session_handle)) print('Delete session: '+str(int(error))) + stopTrigger(test_name) loop.quit() def startSearch(address_index): @@ -460,6 +464,8 @@ def startSearch(address_index): elif country_search_mode == 1: full_string_search(location_input_handle, target_search_string) +startTrigger(test_name) + session = bus.get_object('org.genivi.navigation.navigationcore.Session.v4_0_Session', '/Session') session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.navigationcore.Session.v4_0') diff --git a/test/navigation/test-location-input.py b/test/navigation/test-location-input.py index f6e29de..2d5fe1f 100755 --- a/test/navigation/test-location-input.py +++ b/test/navigation/test-location-input.py @@ -36,8 +36,11 @@ import xml.dom.minidom import argparse import sys import errno +from dltTrigger import * #import pdb;pdb.set_trace() +#name of the test +test_name = "location input" # constants as defined in the Navigation API LATITUDE = 0x00a0 @@ -226,10 +229,10 @@ def spell_search(handle, entered_string, search_string, valid_characters, first= dbus.String(spell_character), dbus.UInt16(20)) else: print 'TEST FAILED (Target character can not be entered)' - loop.quit() + exit() else: print 'TEST FAILED (Unexpected completion)' - loop.quit() + exit() else: print 'Full spell match' @@ -273,16 +276,16 @@ def evaluate_address(address, guidable): print 'TEST PASSED' else: print 'TEST FAILED (wrong address)' - loop.quit() + exit() else: print 'TEST FAILED (non-guidable address)' - loop.quit() + exit() address_index = current_address_index + 1 if address_index < len(COUNTRY_STRING): startSearch(address_index) else: print 'END OF THE TEST' - loop.quit() + exit() # Signal receiver @@ -334,7 +337,7 @@ def content_updated_handler(handle, guidable, available_selection_criteria, addr full_string_search(handle, target_search_string) else: print '\nTEST FAILED (Invalid search mode)' - loop.quit() + exit() # Handler for SpellResult callback def spell_result_handler(handle, unique_string, valid_characters, full_match): @@ -356,7 +359,7 @@ def spell_result_handler(handle, unique_string, valid_characters, full_match): if len(valid_characters) == 1: if unicode(valid_characters[0]) == u'\x08': print '\nTEST FAILED (Dead end spelling)' - loop.quit() + exit() if unicode(entered_search_string) == unicode(target_search_string): found_exact_match = 1 @@ -400,7 +403,7 @@ def search_result_list_handler(handle, total_size, window_offset, window_size, r location_input_interface.SelectEntry(dbus.UInt32(session_handle), dbus.UInt32(handle), dbus.UInt16(0)) else: print '\nTEST FAILED (Unexpected single result list)' - loop.quit() + exit() elif spell_next_character == 1: spell_next_character = 0 spell_search(handle, entered_search_string, target_search_string, available_characters) @@ -428,6 +431,14 @@ bus.add_signal_receiver(content_updated_handler, def timeout(): print 'Timeout Expired' print '\nTEST FAILED\n' + exit() + +def exit(): + error=location_input_interface.DeleteLocationInput(dbus.UInt32(session_handle),dbus.UInt32(location_input_handle)) + print('Delete location input: '+str(int(error))) + error=session_interface.DeleteSession(dbus.UInt32(session_handle)) + print('Delete session: '+str(int(error))) + stopTrigger(test_name) loop.quit() def startSearch(address_index): @@ -451,7 +462,8 @@ def startSearch(address_index): elif country_search_mode == 1: full_string_search(location_input_handle, target_search_string) - +startTrigger(test_name) + session = bus.get_object('org.genivi.navigationcore.Session', '/org/genivi/navigationcore') session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigationcore.Session') diff --git a/test/navigation/test-map-viewer-control-capi.py b/test/navigation/test-map-viewer-control-capi.py index 9660851..47da06d 100755 --- a/test/navigation/test-map-viewer-control-capi.py +++ b/test/navigation/test-map-viewer-control-capi.py @@ -31,10 +31,13 @@ import dbus import gobject import dbus.mainloop.glib import time - -import pdb +from dltTrigger import * +#import pdb #pdb.set_trace() +#name of the test +test_name = "map viewer" + #constants as defined in the Navigation API LATITUDE = 0x00a0 LONGITUDE = 0x00a1 @@ -76,12 +79,16 @@ def mapviewer_mapViewScaleChanged_handler(mapViewInstanceHandle,scale,isMinMax): dbus.UInt32(sessionhandle), \ dbus.UInt32(mapviewerhandle)) session_interface.deleteSession(sessionhandle) - loop.quit() + exit() #timeout def timeout(): print 'Timeout Expired' print '\nTest FAILED' + exit() + +def exit(): + stopTrigger(test_name) loop.quit() print '\n--------------------------' @@ -98,6 +105,8 @@ bus.add_signal_receiver(mapviewer_mapViewScaleChanged_handler, \ dbus_interface = "org.genivi.navigation.mapviewer.MapViewerControl.v4_0", \ signal_name = "mapViewScaleChanged") +startTrigger(test_name) + session = bus.get_object('org.genivi.navigation.mapviewer.Session.v4_0_Session','/Session') session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.mapviewer.Session.v4_0') diff --git a/test/navigation/test-map-viewer-control.py b/test/navigation/test-map-viewer-control.py index ae4219b..628e706 100755 --- a/test/navigation/test-map-viewer-control.py +++ b/test/navigation/test-map-viewer-control.py @@ -31,9 +31,12 @@ import dbus import gobject import dbus.mainloop.glib import time - +from dltTrigger import * #import pdb; pdb.set_trace() +#name of the test +test_name = "map viewer" + #constants as defined in the Navigation API LATITUDE = 0x00a0 LONGITUDE = 0x00a1 @@ -75,14 +78,17 @@ def mapviewer_mapViewScaleChanged_handler(mapViewInstanceHandle,scale,isMinMax): dbus.UInt32(sessionhandle), \ dbus.UInt32(mapviewerhandle)) session_interface.DeleteSession(sessionhandle) - loop.quit() + exit() #timeout def timeout(): print 'Timeout Expired' print '\nTest FAILED' - loop.quit() + exit() +def exit(): + stopTrigger(test_name) + loop.quit() print '\n--------------------------' print 'MapViewerControl Test' @@ -100,6 +106,8 @@ bus.add_signal_receiver(mapviewer_mapViewScaleChanged_handler, \ signal_name = "MapViewScaleChanged") +startTrigger(test_name) + session = bus.get_object('org.genivi.mapviewer.Session','/org/genivi/mapviewer') session_interface = dbus.Interface(session, dbus_interface='org.genivi.mapviewer.Session') diff --git a/test/navigation/test-poi.py b/test/navigation/test-poi.py index e5f1291..6346175 100755 --- a/test/navigation/test-poi.py +++ b/test/navigation/test-poi.py @@ -32,6 +32,11 @@ import time import pdb; #pdb.set_trace() +from dltTrigger import * + +#name of the test +test_name = "poi search" + #constants as defined in the Navigation API GENIVI_Configuration_Settings_LOCALE = 37 GENIVI_SearchStatusState_FINISHED = 1298 @@ -65,7 +70,7 @@ def catch_poi_poiStatus_signal_handler(poiSearchHandle,statusValue): elif statusValue == GENIVI_SearchStatusState_NOT_STARTED: g_poiSearch_interface.deletePoiSearchHandle(poiSearchHandle) print("Test PASSED") - loop.quit() + exit() def catch_poi_resultListChanged_signal_handler(poiSearchHandle,resultListSize): poiList=[] @@ -87,6 +92,10 @@ def catch_poi_resultListChanged_signal_handler(poiSearchHandle,resultListSize): def timeout(): print ('Timeout Expired') print ('\nTest FAILED') + exit() + +def exit(): + stopTrigger(test_name) loop.quit() if __name__ == '__main__': @@ -109,6 +118,8 @@ bus.add_signal_receiver(catch_poi_resultListChanged_signal_handler, \ dbus_interface = "org.genivi.poiservice.POISearch", \ signal_name = "resultListChanged") +startTrigger(test_name) + poiConfiguration = bus.get_object('org.genivi.poiservice.POIConfiguration','/org/genivi/poiservice') g_poiConfiguration_interface = dbus.Interface(poiConfiguration, dbus_interface='org.genivi.navigation.poiservice.POIConfiguration') diff --git a/test/navigation/test-route-calculation-capi.py b/test/navigation/test-route-calculation-capi.py index 31e8b0c..1c44d10 100755 --- a/test/navigation/test-route-calculation-capi.py +++ b/test/navigation/test-route-calculation-capi.py @@ -38,11 +38,13 @@ import xml.dom.minidom import argparse import sys import errno - -import pdb; +#import pdb; #pdb.set_trace() - from pip import locations +from dltTrigger import * + +#name of the test +test_name = "route calculation" #constants as defined in the Navigation API GENIVI_NAVIGATIONCORE_LATITUDE = 0x00a0 @@ -138,7 +140,7 @@ def session_signals_handler(sessionHandle): print 'Test PASSED' else: print 'Test FAILED' - loop.quit() + exit() def route_deleted_signals_handler(routeHandle): print('Route handle deleted: '+str(routeHandle)) @@ -159,6 +161,10 @@ bus.add_signal_receiver(session_signals_handler, \ def timeout(): print 'Timeout Expired' print '\nTest FAILED' + exit() + +def exit(): + stopTrigger(test_name) loop.quit() def launch_route_calculation(route): @@ -187,11 +193,11 @@ def launch_route_calculation(route): dbus.Dictionary({dbus.Int32(GENIVI_NAVIGATIONCORE_LATITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data][0])]),dbus.Int32(GENIVI_NAVIGATIONCORE_LONGITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data][1])])}), \ dbus.Dictionary({dbus.Int32(GENIVI_NAVIGATIONCORE_LATITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("destination")[0].childNodes[0].data][0])]),dbus.Int32(GENIVI_NAVIGATIONCORE_LONGITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("destination")[0].childNodes[0].data][1])])}) \ ]) \ - ) - + ) #calculate route g_routing_interface.calculateRoute(dbus.UInt32(g_session_handle),dbus.UInt32(g_route_handle)) +startTrigger(test_name) session = bus.get_object('org.genivi.navigation.navigationcore.Session.v4_0_Session','/Session') g_session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.navigationcore.Session.v4_0') diff --git a/test/navigation/test-route-calculation.py b/test/navigation/test-route-calculation.py index 281b9b7..35fd997 100755 --- a/test/navigation/test-route-calculation.py +++ b/test/navigation/test-route-calculation.py @@ -38,10 +38,12 @@ import xml.dom.minidom import argparse import sys import errno - #import pdb;pdb.set_trace() - from pip import locations +from dltTrigger import * + +#name of the test +test_name = "route calculation" #constants as defined in the Navigation API GENIVI_NAVIGATIONCORE_LATITUDE = 0x00a0 @@ -137,7 +139,7 @@ def catchall_session_signals_handler(sessionHandle): print 'Test PASSED' else: print 'Test FAILED' - loop.quit() + exit() def catchall_route_deleted_signals_handler(routeHandle): print('Route handle deleted: '+str(routeHandle)) @@ -158,6 +160,10 @@ bus.add_signal_receiver(catchall_session_signals_handler, \ def timeout(): print 'Timeout Expired' print '\nTest FAILED' + exit() + +def exit(): + stopTrigger(test_name) loop.quit() def launch_route_calculation(route): @@ -185,11 +191,11 @@ def launch_route_calculation(route): dbus.Dictionary({dbus.UInt16(GENIVI_NAVIGATIONCORE_LATITUDE):dbus.Struct([0,dbus.Double(locations[routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data][0])]),dbus.UInt16(GENIVI_NAVIGATIONCORE_LONGITUDE):dbus.Struct([0,dbus.Double(locations[routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data][1])])}), \ dbus.Dictionary({dbus.UInt16(GENIVI_NAVIGATIONCORE_LATITUDE):dbus.Struct([0,dbus.Double(locations[routes[g_current_route].getElementsByTagName("destination")[0].childNodes[0].data][0])]),dbus.UInt16(GENIVI_NAVIGATIONCORE_LONGITUDE):dbus.Struct([0,dbus.Double(locations[routes[g_current_route].getElementsByTagName("destination")[0].childNodes[0].data][1])])}) \ ]) \ - ) - + ) #calculate route g_routing_interface.CalculateRoute(dbus.UInt32(g_session_handle),dbus.UInt32(g_route_handle)) +startTrigger(test_name) session = bus.get_object('org.genivi.navigationcore.Session','/org/genivi/navigationcore') g_session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigationcore.Session') |