summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorphilippe colliot <philippe.colliot@mpsa.com>2014-04-18 18:54:02 +0200
committerphilippe colliot <philippe.colliot@mpsa.com>2014-04-18 18:54:02 +0200
commit266fe82cf9252e39e70e5c272f8d29b17a5456ef (patch)
treedb7a0b4eaf8771187d942531e572bebefbda81e0 /test
parentceb6e361b0277625750f8319cd243b8a8eba98cd (diff)
downloadnavigation-266fe82cf9252e39e70e5c272f8d29b17a5456ef.tar.gz
FSA: draft of scripts for the demo
Diffstat (limited to 'test')
-rw-r--r--test/resource/enter-a-destination.log0
-rw-r--r--test/resource/fuel-level-low.log0
-rw-r--r--test/resource/initialization-step1.log10
-rw-r--r--test/resource/initialization-step2.log0
-rw-r--r--test/resource/start-with-guidance-step1.log0
-rw-r--r--test/resource/start-with-guidance-step2.log0
-rw-r--r--test/resource/start-without-guidance-step1.log0
-rw-r--r--test/resource/start-without-guidance-step2.log0
-rw-r--r--test/script/.gitignore1
-rw-r--r--test/script/FSA-simulation-scenarios.pngbin0 -> 19483 bytes
-rw-r--r--test/script/configTests.py44
-rw-r--r--test/script/enter-a-destination.py0
-rw-r--r--test/script/fuel-level-low.py0
-rw-r--r--test/script/initialization.py65
-rw-r--r--test/script/start-with-guidance.py0
-rw-r--r--test/script/start-without-guidance.py0
16 files changed, 120 insertions, 0 deletions
diff --git a/test/resource/enter-a-destination.log b/test/resource/enter-a-destination.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/resource/enter-a-destination.log
diff --git a/test/resource/fuel-level-low.log b/test/resource/fuel-level-low.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/resource/fuel-level-low.log
diff --git a/test/resource/initialization-step1.log b/test/resource/initialization-step1.log
new file mode 100644
index 0000000..ebfc12a
--- /dev/null
+++ b/test/resource/initialization-step1.log
@@ -0,0 +1,10 @@
+#Log file for the FSA simulator
+#ignition key OFF
+#fuel level 30 l
+#engine speed 0 RPM
+#vehicle speed 0 km/h
+#fuel 0
+#localization
+0,0$GVGNSVER,2,0,0
+0,0$GVSNSVER,2,0,0
+
diff --git a/test/resource/initialization-step2.log b/test/resource/initialization-step2.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/resource/initialization-step2.log
diff --git a/test/resource/start-with-guidance-step1.log b/test/resource/start-with-guidance-step1.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/resource/start-with-guidance-step1.log
diff --git a/test/resource/start-with-guidance-step2.log b/test/resource/start-with-guidance-step2.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/resource/start-with-guidance-step2.log
diff --git a/test/resource/start-without-guidance-step1.log b/test/resource/start-without-guidance-step1.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/resource/start-without-guidance-step1.log
diff --git a/test/resource/start-without-guidance-step2.log b/test/resource/start-without-guidance-step2.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/resource/start-without-guidance-step2.log
diff --git a/test/script/.gitignore b/test/script/.gitignore
new file mode 100644
index 0000000..0d20b64
--- /dev/null
+++ b/test/script/.gitignore
@@ -0,0 +1 @@
+*.pyc
diff --git a/test/script/FSA-simulation-scenarios.png b/test/script/FSA-simulation-scenarios.png
new file mode 100644
index 0000000..0259c41
--- /dev/null
+++ b/test/script/FSA-simulation-scenarios.png
Binary files differ
diff --git a/test/script/configTests.py b/test/script/configTests.py
new file mode 100644
index 0000000..268d3fe
--- /dev/null
+++ b/test/script/configTests.py
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+
+"""
+**************************************************************************
+* @licence app begin@
+* SPDX-License-Identifier: MPL-2.0
+*
+* \copyright Copyright (C) 2014, PCA Peugeot Citroen
+*
+* \file config-tests.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:
+* <date>, <name>, <description of change>
+*
+* @licence end@
+
+**************************************************************************
+"""
+import subprocess
+from subprocess import call
+
+PATH_LOGREPLAYER='/genivi/positioning/build/log-replayer/src/'
+PATH_LOGFILES='../resource/'
+
+def launch(file):
+ logreplayer=PATH_LOGREPLAYER + 'log-replayer'
+ file=PATH_LOGFILES + file
+ arguments='> /dev/null 2>&1 &'
+ print logreplayer
+ print file
+ call([logreplayer, file, arguments])
+
+
+
diff --git a/test/script/enter-a-destination.py b/test/script/enter-a-destination.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/script/enter-a-destination.py
diff --git a/test/script/fuel-level-low.py b/test/script/fuel-level-low.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/script/fuel-level-low.py
diff --git a/test/script/initialization.py b/test/script/initialization.py
new file mode 100644
index 0000000..8d5fc0c
--- /dev/null
+++ b/test/script/initialization.py
@@ -0,0 +1,65 @@
+#!/usr/bin/python
+
+"""
+**************************************************************************
+* @licence app begin@
+* SPDX-License-Identifier: MPL-2.0
+*
+* \copyright Copyright (C) 2014, PCA Peugeot Citroen
+*
+* \file initialization.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:
+* <date>, <name>, <description of change>
+*
+* @licence end@
+
+**************************************************************************
+"""
+import configTests
+import sys
+import gobject
+
+from threading import Timer
+from configTests import *
+
+PERIODICITY = 200 #in ms
+END_STEP_1 = 2*1000/PERIODICITY #2 s
+END_STEP_2 = 7*1000/PERIODICITY #7 s
+
+def steps():
+ global step
+ if step < END_STEP_1:
+ if step == 0:
+ print 'step 1'
+ launch("initialization-step1.log")
+ step = step + 1
+ return True
+ elif step < END_STEP_2:
+ if step == END_STEP_1:
+ print 'step 2'
+ launch("initialization-step2.log")
+ step = step + 1
+ return True
+ else:
+ print '----End scenario: Initialization----'
+ loop.quit()
+
+print '----Start scenario: Initialization----'
+
+# start
+step = 0
+gobject.timeout_add(PERIODICITY,steps)
+loop = gobject.MainLoop()
+loop.run()
+
diff --git a/test/script/start-with-guidance.py b/test/script/start-with-guidance.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/script/start-with-guidance.py
diff --git a/test/script/start-without-guidance.py b/test/script/start-without-guidance.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/script/start-without-guidance.py