summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattijs Korpershoek <mattijsx.korpershoek@intel.com>2014-04-18 08:52:05 +0200
committerMattijs Korpershoek <mattijsx.korpershoek@intel.com>2014-06-25 10:52:25 +0200
commit397cfb624defe0b4fcb22351536478379fdc711a (patch)
tree32597c650a2466873a817961655ffd5ae35ddd05
parent0719893e44a7ada2e4fe46b97c173d0453bc0ded (diff)
downloadexternal_parameter-framework-397cfb624defe0b4fcb22351536478379fdc711a.zip
external_parameter-framework-397cfb624defe0b4fcb22351536478379fdc711a.tar.gz
external_parameter-framework-397cfb624defe0b4fcb22351536478379fdc711a.tar.bz2
Updated hostDomainGenerator.sh schema validation
BZ: 188323 In order to validate xml files, we need the corresponding schemas to be next to the xml files. Those are put by the script in /tmp. This patch add the copying of the schema files to /tmp. I also adds an optional command line argument to disable/enable validation. This is useful for platform specific enabling/disabling validation. It can be used by calling hostDomainGenerator.sh --validate. Change-Id: I7da65f230e5abf5b1d18c5cd6cf11b67dae5ed76 Signed-off-by: Mattijs Korpershoek <mattijsx.korpershoek@intel.com>
-rwxr-xr-xtools/xmlGenerator/hostDomainGenerator.sh25
1 files changed, 23 insertions, 2 deletions
diff --git a/tools/xmlGenerator/hostDomainGenerator.sh b/tools/xmlGenerator/hostDomainGenerator.sh
index 1af42ba..4cfce4d 100755
--- a/tools/xmlGenerator/hostDomainGenerator.sh
+++ b/tools/xmlGenerator/hostDomainGenerator.sh
@@ -52,6 +52,11 @@ exec 5> >(sed "s/^/($$) Warning: /" >&2)
exec 2> >(sed "s/^/($$) Error: /" >&2)
# Get script arguments
+validationEnabled="false"
+if [ "$1" = "--validate" ]; then
+ validationEnabled="true"
+ shift
+fi
PFWconfigurationFilePath="$1"; shift
CriterionFilePath="$1"; shift
xmlDomainFilePath="$1"; shift
@@ -76,7 +81,8 @@ TPSocket=5003
PFWSocket=5000
PFWStartTimeout=60
-tmpFile=$(mktemp)
+tmpDir=$(mktemp -d)
+tmpFile=$(mktemp --tmpdir="$tmpDir")
# [Workaround]
# The build system does not preserve execution right in external prebuild
@@ -112,6 +118,12 @@ clean_up () {
echo "Cleaning $tmpFile ..."
rm "$tmpFile" || true
+ if [ "$validationEnabled" = "true" ]; then
+ echo "Cleaning $tmpDir/Schemas ..."
+ rm -r "$tmpDir/Schemas" || true
+ rmdir "$tmpDir" || true
+ fi
+
echo "Cleaning status: $status ..."
return $status
}
@@ -201,7 +213,7 @@ launchTestPlatform () {
$TPSendCommand setFailureOnMissingSubsystem false
$TPSendCommand setFailureOnFailedSettingsLoad false
- $TPSendCommand setValidateSchemasOnStart false
+ $TPSendCommand setValidateSchemasOnStart $validationEnabled
echo "Asking test-platform (port $TPSocket) to start a new PFW instance (listening on port $PFWSocket) ..."
$TPSendCommand start
@@ -264,6 +276,15 @@ deleteEscapedNewLines () {
sed -r ':a;/\\$/{N;s/\\\n//;ba}'
}
+copySchemaFiles() {
+ cp -r "$HostRoot"/etc/parameter-framework/Schemas "$tmpDir/Schemas"
+}
+
+# Copy the schema files needed for validation
+if [ "$validationEnabled" = "true" ]; then
+ copySchemaFiles
+fi
+
# The PFW looks for a libremote-processor.so library, not a libremote-processor_host.so
linkLibrary libremote-processor_host.so libremote-processor.so