summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Residori <marco.residori@xse.de>2014-07-22 05:43:50 -0700
committerMarco Residori <marco.residori@xse.de>2014-07-22 05:43:50 -0700
commit0bd8382a38198cd884f8b34e592a7453a0876643 (patch)
tree1bf315f04825afc4958de33c7698e52bf6302b40
parent3b5b8229821db9a6d3cde48c146f188e9f40f629 (diff)
downloadpositioning-0bd8382a38198cd884f8b34e592a7453a0876643.tar.gz
Add test scripts (perl and python)
-rwxr-xr-xenhanced-position-service/test/test-scripts/positioning-monitor.pl59
1 files changed, 59 insertions, 0 deletions
diff --git a/enhanced-position-service/test/test-scripts/positioning-monitor.pl b/enhanced-position-service/test/test-scripts/positioning-monitor.pl
new file mode 100755
index 0000000..624f3a4
--- /dev/null
+++ b/enhanced-position-service/test/test-scripts/positioning-monitor.pl
@@ -0,0 +1,59 @@
+#! /usr/bin/perl -w
+###########################################################################
+# Component Name: Navit POC
+# Author: Martin Schaller <martin.schaller@it-schaller.de>
+#
+# Copyright (C) 2012, GENIVI Alliance, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+###########################################################################
+$| = 1;
+open(MON,"dbus-monitor|");
+while (<MON>) {
+ if (/^method call.*;\ interface=org\.genivi\.positioning/) {
+ $serial=$_;
+ $serial=~s/.*serial=//;
+ $serial=~s/\ path=.*//;
+ $active=1;
+ print $_;
+ $serials{$serial}=1;
+ } elsif (/^method return/) {
+ $serial=$_;
+ $serial=~s/.*reply_serial=//;
+ if ($serials{$serial}) {
+ delete($serials{$serial});
+ $active=1;
+ print $_;
+ }
+ } elsif (/^error /) {
+ $serial=$_;
+ $serial=~s/.*reply_serial=//;
+ if ($serials{$serial}) {
+ delete($serials{$serial});
+ $active=1;
+ print $_;
+ }
+ } elsif (/^signal.*;\ interface=org\.genivi\.positioning/) {
+ $active=1;
+ print $_;
+ } elsif (/^ +/) {
+ if ($active) {
+ print $_;
+ }
+ } else {
+ $active=0;
+ }
+}
+close(MON);