aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xmlGenerator/analyse
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2012-09-20 18:41:55 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:32 +0100
commit85d6dd65ad91d04eb847dfbc50b914f3739511e7 (patch)
tree0dfa3417b5c8f0d651dc2cf71b8ac14ee13122db /tools/xmlGenerator/analyse
parent5d6e05ab8d9ecc00d4542a0d76bd1ad9bd7ff88c (diff)
downloadexternal_parameter-framework-85d6dd65ad91d04eb847dfbc50b914f3739511e7.zip
external_parameter-framework-85d6dd65ad91d04eb847dfbc50b914f3739511e7.tar.gz
external_parameter-framework-85d6dd65ad91d04eb847dfbc50b914f3739511e7.tar.bz2
PFW: Test scripts & XML generator scripts
BZ: 80506 This patch adds scripts to generate and test PFW domain XML. tools/xmlGenerator provides script to generate PFW domains from XML: - updateRoutageDomains.sh update the domains of the connected board with the provided .pfw file. - lightRoutingUpdate.sh is a light version of updateRoutageDomains.sh it does not need test-platform but needs a board with a properly configure PFW (typicaly the hal pfw). - analyse provide script to convert asound.conf to domains test/test-scripts provides scripts to instanciate a test platform (virtal hal) and simulate the route manager routing steps: - */*_envsetup.sh is a list of environement configation file. Source the file corresponding to your situation. - test-routing.sh allow the user to simulate different routing use cases. Change-Id: I00931a3b0868496c36ba1ad298ed89e07582dd61 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/67268 Reviewed-by: Boisnard, FredericX <fredericx.boisnard@intel.com> Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'tools/xmlGenerator/analyse')
-rwxr-xr-xtools/xmlGenerator/analyse/replaceAmixerByPfwParameters.sh59
-rwxr-xr-xtools/xmlGenerator/analyse/sortAsound.conf.sh79
2 files changed, 138 insertions, 0 deletions
diff --git a/tools/xmlGenerator/analyse/replaceAmixerByPfwParameters.sh b/tools/xmlGenerator/analyse/replaceAmixerByPfwParameters.sh
new file mode 100755
index 0000000..d159aa5
--- /dev/null
+++ b/tools/xmlGenerator/analyse/replaceAmixerByPfwParameters.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# INTEL CONFIDENTIAL
+# Copyright 2013 Intel
+# Corporation All Rights Reserved.
+#
+# The source code contained or described herein and all documents related to
+# the source code ("Material") are owned by Intel Corporation or its suppliers
+# or licensors. Title to the Material remains with Intel Corporation or its
+# suppliers and licensors. The Material contains trade secrets and proprietary
+# and confidential information of Intel or its suppliers and licensors. The
+# Material is protected by worldwide copyright and trade secret laws and
+# treaty provisions. No part of the Material may be used, copied, reproduced,
+# modified, published, uploaded, posted, transmitted, distributed, or
+# disclosed in any way without Intels prior express written permission.
+#
+# No license under any patent, copyright, trade secret or other intellectual
+# property right is granted to or conferred upon you by disclosure or delivery
+# of the Materials, either expressly, by implication, inducement, estoppel or
+# otherwise. Any license under such intellectual property rights must be
+# express and approved by Intel in writing.
+
+set -ue
+
+# Replace amixer in stdio by the parameter equivalent
+# A convertion table file must be passed in argument
+# It is design to be work with the output of scripts/sortAsound.conf.sh
+
+# a perl regexp that matches only alsa mixer lines
+regexp='^[^\s/]'
+
+if test $# != 1 || test ! -f $1
+then
+ echo "argument 1 must be a convertion file like this :
+/.../parameter1 alsa mixeur 1
+/.../parameter2 alsa mixeur 2
+..."
+ exit 1
+fi
+
+find_pfw_equivalent(){
+ if pfw_equivalent="$(grep $1 $2)"
+ then
+ echo $pfw_equivalent | sed 's/ .*//'
+ else
+ return 1
+ fi
+}
+
+
+while IFS=''; read -r line
+do
+ if echo "$line" | grep -qP "$regexp" && parameter="$(find_pfw_equivalent "$line" $1)"
+ then
+ echo "$parameter ( $line )"
+ else
+ echo "$line"
+ fi
+done
diff --git a/tools/xmlGenerator/analyse/sortAsound.conf.sh b/tools/xmlGenerator/analyse/sortAsound.conf.sh
new file mode 100755
index 0000000..b607161
--- /dev/null
+++ b/tools/xmlGenerator/analyse/sortAsound.conf.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+# INTEL CONFIDENTIAL
+# Copyright 2013 Intel
+# Corporation All Rights Reserved.
+#
+# The source code contained or described herein and all documents related to
+# the source code ("Material") are owned by Intel Corporation or its suppliers
+# or licensors. Title to the Material remains with Intel Corporation or its
+# suppliers and licensors. The Material contains trade secrets and proprietary
+# and confidential information of Intel or its suppliers and licensors. The
+# Material is protected by worldwide copyright and trade secret laws and
+# treaty provisions. No part of the Material may be used, copied, reproduced,
+# modified, published, uploaded, posted, transmitted, distributed, or
+# disclosed in any way without Intels prior express written permission.
+#
+# No license under any patent, copyright, trade secret or other intellectual
+# property right is granted to or conferred upon you by disclosure or delivery
+# of the Materials, either expressly, by implication, inducement, estoppel or
+# otherwise. Any license under such intellectual property rights must be
+# express and approved by Intel in writing.
+
+
+# This script reads an asound.conf file and produce for each alsa mixeur
+# it's differend values and pcm
+#
+# ouput example :
+#
+# my_alsa_mixeur
+# true
+# a_pcm
+# an_other_pcm
+# false
+# in_this_pcm_my_alsa_mixer_takes_the_value_false
+# ...
+
+set -eu
+
+if test $# = 0
+then
+ file="-"
+else
+ file="$1"
+fi
+
+space=" "
+previous_command=""
+
+sed -nr -e 's#^pcm.(.*)\{.*$#\1#; t save;
+ b next;
+ :save;h;b' \
+ \
+ -e ':next; s/.*name "(.*)" value ([^}]*).*/\1 = \2 # /; t pcm;
+ b;
+ :pcm; G;s/\n//p;' -- "$file" |
+ sort | \
+ while read line
+ do
+ current_command="$( echo "$line" | sed 's/ =.*#.*//' )"
+ #values are case insensitive
+ current_value="$( echo "$line" | sed 's/.*= \(.*\) #.*/\1/' | tr [:upper:] [:lower:] )"
+ current_mode="$( echo "$line" | sed 's/.*# //' )"
+
+ if test "$previous_command" != "$current_command"
+ then
+ echo "$current_command"
+ previous_command="$current_command"
+ previous_value=""
+ fi
+
+
+ if test "$previous_value" != "$current_value"
+ then
+ echo "$space$current_value"
+ previous_value="$current_value"
+ fi
+
+ echo "$space$space$current_mode"
+ done