summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorBotao Sun <botao.sun@linaro.org>2014-10-17 00:49:58 +1100
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-10-20 13:44:14 +0000
commitf9f4e66349dab083e90e9d1536bfd325740cc4a2 (patch)
treef148bee9c6661340884f79755b451416821ca8f4 /android
parent116e1fe62aef1b924ae61906c632064c1d64a2a9 (diff)
gator-data-streaming.sh: POSIX Compliant Update.
This change is to make the test script to be POSIX compliant. Original patch comes from: Lucas Dutra Nunes <ldnunes@ossystems.com.br> Signed-off by: Botao Sun <botao.sun@linaro.org> Change-Id: I32bf72a800a0b2167dc4ab2da418977580583ad7
Diffstat (limited to 'android')
-rwxr-xr-xandroid/scripts/gator-data-streaming.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/android/scripts/gator-data-streaming.sh b/android/scripts/gator-data-streaming.sh
index e6ad080..8895733 100755
--- a/android/scripts/gator-data-streaming.sh
+++ b/android/scripts/gator-data-streaming.sh
@@ -2,7 +2,7 @@
#
# Gator data streaming test for Linaro Android
#
-# Copyright (C) 2013, Linaro Limited.
+# Copyright (C) 2010 - 2014, Linaro Limited.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -20,7 +20,7 @@
#
# Author: Botao Sun <botao.sun@linaro.org>
-function check_return_fail() {
+check_return_fail() {
if [ $? -ne 0 ]; then
fail_test "$1"
return 0
@@ -29,17 +29,17 @@ function check_return_fail() {
fi
}
-function fail_test() {
+fail_test() {
local reason=$1
echo "${TEST}: FAIL - ${reason}"
}
-function pass_test() {
+pass_test() {
echo "${TEST}: PASS"
}
-function check_root() {
- if [ `whoami` == "root" ]; then
+check_root() {
+ if [ `whoami` = "root" ]; then
return 0
else
return 1
@@ -47,7 +47,11 @@ function check_root() {
}
# Create sample XML file as a template
-echo -ne "<?xml version="1.0" encoding="US-ASCII" ?> \n<session version="1" output_path="x" call_stack_unwinding="yes" parse_debug_info="yes" \nhigh_resolution="no" buffer_mode="streaming" sample_rate="normal" duration="10" \ntarget_host="linaro-android-boards" target_port="8080"> \n</session> \n" > $EXTERNAL_STORAGE/session.xml
+echo "<?xml version=\"1.0\" encoding=\"US-ASCII\" ?> " > $EXTERNAL_STORAGE/session.xml
+echo "<session version=\"1\" output_path=\"x\" call_stack_unwinding=\"yes\" parse_debug_info=\"yes\" " >> $EXTERNAL_STORAGE/session.xml
+echo "high_resolution=\"no\" buffer_mode=\"streaming\" sample_rate=\"normal\" duration=\"10\" " >> $EXTERNAL_STORAGE/session.xml
+echo "target_host=\"linaro-android-boards\" target_port=\"8080\"> " >> $EXTERNAL_STORAGE/session.xml
+echo "</session>" >> $EXTERNAL_STORAGE/session.xml
## Test case definitions