From d4ffa038f88de53162cb7581166fc2b72ba3c4b5 Mon Sep 17 00:00:00 2001 From: Marco Residori Date: Thu, 29 Oct 2015 09:05:55 +0100 Subject: Change URL of Firebreath to avoid issues with company proxy and improve test scripts --- .../test-scripts/run-enhanced-position-service.sh | 20 +++-- ...test-enhanced-position-service-configuration.py | 87 ++++++++++++++++++++++ position-web-service/script/build-plugin.sh | 2 +- position-web-service/script/run-test.sh | 6 +- 4 files changed, 100 insertions(+), 15 deletions(-) create mode 100755 enhanced-position-service/dbus/test/test-scripts/test-enhanced-position-service-configuration.py diff --git a/enhanced-position-service/dbus/test/test-scripts/run-enhanced-position-service.sh b/enhanced-position-service/dbus/test/test-scripts/run-enhanced-position-service.sh index 87ea60e..51a245f 100755 --- a/enhanced-position-service/dbus/test/test-scripts/run-enhanced-position-service.sh +++ b/enhanced-position-service/dbus/test/test-scripts/run-enhanced-position-service.sh @@ -17,18 +17,13 @@ # @licence end@ ########################################################################### -TOP_DIR=../../.. +TOP_DIR=../../../.. -BIN_DIR=$TOP_DIR/build/log-replayer/src -LOGS_DIR=$TOP_DIR/log-replayer/logs -BIN=log-replayer -LOG=geneve-cologny.log - -CMD="$BIN_DIR/$BIN $LOGS_DIR/$LOG > /dev/null 2>&1" +LOG=$TOP_DIR/log-replayer/logs/geneve-cologny.log usage() { echo "Usage: " - echo " run-logreplayer.sh [option]" + echo " run-enhanced-position-service.sh [option]" echo " -d daemonize" echo " -k kill" echo " -h help" @@ -38,16 +33,19 @@ usage() { if [ $# -ge 1 ]; then if [ $1 = "-d" ]; then echo "Starting log-replayer..." - eval "$CMD" & + eval "$TOP_DIR/build/log-replayer/src/log-replayer $LOG > /dev/null 2>&1" & + echo "Starting enhanced-position-service..." + eval "$TOP_DIR/build/enhanced-position-service/dbus/src/enhanced-position-service > /dev/null 2>&1" & elif [ $1 = "-k" ]; then killall log-replayer + killall enhanced-position-service elif [ $1 = "-h" ]; then usage fi else - echo "Starting log-replayer..." - eval "$CMD" + usage fi + diff --git a/enhanced-position-service/dbus/test/test-scripts/test-enhanced-position-service-configuration.py b/enhanced-position-service/dbus/test/test-scripts/test-enhanced-position-service-configuration.py new file mode 100755 index 0000000..44c6855 --- /dev/null +++ b/enhanced-position-service/dbus/test/test-scripts/test-enhanced-position-service-configuration.py @@ -0,0 +1,87 @@ +#!/usr/bin/python + +""" +************************************************************************** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 2014, XS Embedded GmbH +* +* \file test-enhanced-position-service.py +* +* \brief This simple test shows how the enhanced-position-service +* can be easily tested using a python script +* +* \author Marco Residori +* +* \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 dbus +import gobject +import dbus.mainloop.glib + +#constants as defined in the Positioning API +LATITUDE = 0x00000001 +LONGITUDE = 0x00000002 +ALTITUDE = 0x00000004 +CLIMB = 0x00000020 +SPEED = 0x00000010 +HEADING = 0x00000008 + +print '\n--------------------------' +print 'Positioning Test' +print '--------------------------\n' + +if __name__ == '__main__': + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + +#connect to session bus +bus = dbus.SessionBus() + +#signal receiver +def catchall_positioning_signals_handler(changedValues): + print 'PropertyChanged' + satSystem = enhanced_position_interface.GetProperty(dbus.String("SatelliteSystem")) + + print 'SatelliteSystem:' +str(satSystem) + + +#add signal receiver +bus.add_signal_receiver(catchall_positioning_signals_handler, \ + dbus_interface = "org.genivi.positioning.Configuration", \ + signal_name = "PropertyChanged") + +#timeout +def timeout(): + print '\nTest Finished\n' + loop.quit() + +#get object +enhanced_position = bus.get_object('org.genivi.positioning.EnhancedPosition','/org/genivi/positioning/Configuration') + +#get interface +enhanced_position_interface = dbus.Interface(enhanced_position, dbus_interface='org.genivi.positioning.Configuration') + +#enhanced_position_interface.SetProperty(dbus.String('SatelliteSystem'),dbus.UInt32(2, variant_level=1)) +enhanced_position_interface.SetProperty(dbus.String('UpdateInterval'),dbus.UInt32(2, variant_level=1)) + +#satSystem = enhanced_position_interface.GetProperty(dbus.String('SatelliteSystem')) +#print 'SatelliteSystem:' + str(satSystem) + +#main loop + +gobject.timeout_add(10000, timeout) +loop = gobject.MainLoop() +loop.run() + + diff --git a/position-web-service/script/build-plugin.sh b/position-web-service/script/build-plugin.sh index 9ef2552..010ebda 100755 --- a/position-web-service/script/build-plugin.sh +++ b/position-web-service/script/build-plugin.sh @@ -81,7 +81,7 @@ else usage elif [ $1 = prepmake ]; then if [ ! -d "$SRC_DIR/firebreath-dev" ]; then - git clone git://github.com/firebreath/FireBreath.git -b firebreath-$FB_VER $SRC_DIR/firebreath-dev + git clone https://github.com/firebreath/FireBreath.git -b firebreath-$FB_VER $SRC_DIR/firebreath-dev fi $SRC_DIR/firebreath-dev/prepmake.sh $SRC_DIR/fbprojects $SRC_DIR/fbbuild elif [ $1 = make ]; then diff --git a/position-web-service/script/run-test.sh b/position-web-service/script/run-test.sh index fb0fa8f..c3c54e1 100755 --- a/position-web-service/script/run-test.sh +++ b/position-web-service/script/run-test.sh @@ -18,9 +18,9 @@ # @licence end@ ########################################################################### -killall enhanced-position-client -killall enhanced-position-service -killall log-replayer +killall enhanced-position-client > /dev/null 2>&1 +killall enhanced-position-service > /dev/null 2>&1 +killall log-replayer > /dev/null 2>&1 cd ../.. -- cgit v1.2.1