From: jiehua.xiong Date: Wed, 9 Oct 2013 04:45:44 +0000 (+0800) Subject: Update tct-testconfig for bluetooth and messaging testing X-Git-Tag: 2.2.1_release~103^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cbe47bcb9dea552027368e6ee6a7754961bc7ad;p=test%2Ftct%2Fweb%2Fapi.git Update tct-testconfig for bluetooth and messaging testing Use json to update constant variable in AJAX Change-Id: I338ef5a7bf3aa8258b33f00738404a31e99d9a24 --- diff --git a/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js b/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js index 41edbe3f6..6b4d851ed 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js +++ b/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js @@ -331,3 +331,7 @@ function cancelDiscovery() { console.log("Error while stopDiscovery : " + e.message); }) } + +// change REMOTE_DEVICE_ADDRESS and REMOTE_DEVICE_NAME +document.write(''); +document.write(''); diff --git a/tct-bluetooth-tizen-tests/bluetooth/support/getJsonConf.js b/tct-bluetooth-tizen-tests/bluetooth/support/getJsonConf.js new file mode 100644 index 000000000..fa7cef94f --- /dev/null +++ b/tct-bluetooth-tizen-tests/bluetooth/support/getJsonConf.js @@ -0,0 +1,44 @@ +/* +Copyright (c) 2013 Intel Corporation. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of works must retain the original copyright notice, this list + of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the original copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this work without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Authors: + Li, Hao + +*/ + + + +$.ajax({ + url:"/opt/usr/media/tct/preconfigure.json", + dataType:"json", + data:{}, + async:false, + success:function(data){ + REMOTE_DEVICE_ADDRESS = data[0]["BT_REMOTE_DEVICE_ADDRESS"]; + REMOTE_DEVICE_NAME = data[0]["BT_REMOTE_DEVICE_NAME"]; + + } +}) diff --git a/tct-messaging-email-tizen-tests/messaging/support/getJsonConf.js b/tct-messaging-email-tizen-tests/messaging/support/getJsonConf.js new file mode 100644 index 000000000..795247563 --- /dev/null +++ b/tct-messaging-email-tizen-tests/messaging/support/getJsonConf.js @@ -0,0 +1,50 @@ +/* +Copyright (c) 2013 Intel Corporation. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of works must retain the original copyright notice, this list + of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the original copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this work without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Authors: + Li, Hao + +*/ + +$.ajax({ + url:"/opt/usr/media/tct/preconfigure.json", + dataType:"json", + data:{}, + async:false, + success:function(data){ + TEST_EMAIL_RECIPIENT_1 = data[0]["EMAIL_RECIPIENT_1"]; + TEST_EMAIL_RECIPIENT_2 = data[0]["EMAIL_RECIPIENT_2"]; + emailMessageInitDict = { + subject: "sample subject", + to: [TEST_EMAIL_RECIPIENT_1], + cc: [TEST_EMAIL_RECIPIENT_2], + bcc: [TEST_EMAIL_RECIPIENT_1, TEST_EMAIL_RECIPIENT_2], + plainBody: "sample plainBody", + htmlBody: "sample htmlBody", + isHighPriority: false + }; + } +}) diff --git a/tct-messaging-email-tizen-tests/messaging/support/messaging_common.js b/tct-messaging-email-tizen-tests/messaging/support/messaging_common.js index 30cdb1628..c70a80c09 100755 --- a/tct-messaging-email-tizen-tests/messaging/support/messaging_common.js +++ b/tct-messaging-email-tizen-tests/messaging/support/messaging_common.js @@ -198,6 +198,10 @@ function getInboxFolder(t, folders) { return inboxFolder; } +// change TEST_EMAIL_RECIPIENT_1 and TEST_EMAIL_RECIPIENT_2 +document.write(''); +document.write(''); + function findMessages(t, service, folder, subject, onSuccess, onError) { var subjectFilter, folderFilter, compositefilter; diff --git a/tct-messaging-mms-tizen-tests/messaging/support/getJsonConf.js b/tct-messaging-mms-tizen-tests/messaging/support/getJsonConf.js new file mode 100644 index 000000000..e63151a99 --- /dev/null +++ b/tct-messaging-mms-tizen-tests/messaging/support/getJsonConf.js @@ -0,0 +1,47 @@ +/* +Copyright (c) 2013 Intel Corporation. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of works must retain the original copyright notice, this list + of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the original copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this work without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Authors: + Li, Hao + +*/ + + +$.ajax({ + url:"/opt/usr/media/tct/preconfigure.json", + dataType:"json", + data:{}, + async:false, + success:function(data){ + TEST_SMS_RECIPIENT = data[0]["MMS_RECIPIENT_1"]; + TEST_SMS_RECIPIENT_2 = data[0]["MMS_RECIPIENT_2"]; + mmsMessageInitDict = { + subject: "sample subject", + to: [TEST_SMS_RECIPIENT], + plainBody: "sample plainBody" + }; + } +}) diff --git a/tct-messaging-mms-tizen-tests/messaging/support/messaging_common.js b/tct-messaging-mms-tizen-tests/messaging/support/messaging_common.js index 2e251bf32..7e6a1b5e4 100755 --- a/tct-messaging-mms-tizen-tests/messaging/support/messaging_common.js +++ b/tct-messaging-mms-tizen-tests/messaging/support/messaging_common.js @@ -108,3 +108,7 @@ function removeAllMessages(t, service, onSuccess) { service.messageStorage.findMessages(MMStypeFilter, findSuccess, findError); }); } + +// change TEST_SMS_RECIPIENT and TEST_SMS_RECIPIENT_2 +document.write(''); +document.write(''); diff --git a/tct-messaging-sms-tizen-tests/messaging/support/getJsonConf.js b/tct-messaging-sms-tizen-tests/messaging/support/getJsonConf.js new file mode 100644 index 000000000..7faa04586 --- /dev/null +++ b/tct-messaging-sms-tizen-tests/messaging/support/getJsonConf.js @@ -0,0 +1,46 @@ +/* +Copyright (c) 2013 Intel Corporation. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of works must retain the original copyright notice, this list + of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the original copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this work without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Authors: + Li, Hao + +*/ + + +$.ajax({ + url:"/opt/usr/media/tct/preconfigure.json", + dataType:"json", + data:{}, + async:false, + success:function(data){ + TEST_SMS_RECIPIENT = data[0]["SMS_RECIPIENT_1"]; + TEST_SMS_RECIPIENT_2 = data[0]["SMS_RECIPIENT_2"]; + smsMessageInitDict = { + to: [TEST_SMS_RECIPIENT], + plainBody: "sample plainBody" + }; + } +}) diff --git a/tct-messaging-sms-tizen-tests/messaging/support/messaging_common.js b/tct-messaging-sms-tizen-tests/messaging/support/messaging_common.js index 6279e6d10..0393f0624 100755 --- a/tct-messaging-sms-tizen-tests/messaging/support/messaging_common.js +++ b/tct-messaging-sms-tizen-tests/messaging/support/messaging_common.js @@ -105,3 +105,7 @@ function removeAllMessages(t, service, onSuccess) { service.messageStorage.findMessages(typeFilter, findSuccess, findError); }); } + +// change TEST_SMS_RECIPIENT and TEST_SMS_RECIPIENT_2 +document.write(''); +document.write(''); diff --git a/tct-testconfig/preconfigure.json b/tct-testconfig/preconfigure.json new file mode 100644 index 000000000..d600cdc11 --- /dev/null +++ b/tct-testconfig/preconfigure.json @@ -0,0 +1,10 @@ +[{ + "BT_REMOTE_DEVICE_ADDRESS": "127.0.0.1", + "BT_REMOTE_DEVICE_NAME": "localhost", + "EMAIL_RECIPIENT_1": "123@intel.com", + "EMAIL_RECIPIENT_2": "456@intel.com", + "MMS_RECIPIENT_1": "123456789", + "MMS_RECIPIENT_2": "987654321", + "SMS_RECIPIENT_1": "123456789", + "SMS_RECIPIENT_2": "987654321" +}] diff --git a/tct-testconfig/tct-testconfig.ini b/tct-testconfig/tct-testconfig.ini index dd52fafa5..b8949f7fb 100755 --- a/tct-testconfig/tct-testconfig.ini +++ b/tct-testconfig/tct-testconfig.ini @@ -25,5 +25,3 @@ MMS_RECIPIENT_2=your MMS recipient 2 SMS_RECIPIENT_1=your SMS recipient 1 # Second SMS recipient, must be set to phone number(different from first SMS recipient and without country calling code) SMS_RECIPIENT_2=your SMS recipient 2 -[tct-geoallow-w3c-tests] -[tct-geodeny-w3c-tests] diff --git a/tct-testconfig/tct-testconfig.sh b/tct-testconfig/tct-testconfig.sh deleted file mode 100755 index f1eae9a16..000000000 --- a/tct-testconfig/tct-testconfig.sh +++ /dev/null @@ -1,324 +0,0 @@ -#!/bin/bash -## -# Copyright (c) 2012 Intel Corporation. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of works must retain the original copyright notice, this list -# of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the original copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of Intel Corporation nor the names of its contributors -# may be used to endorse or promote products derived from this work without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Authors: -# Yugang.fan -# Lin, Wanming - -CONFIG_FILE= -CONFIG_GEO= -BT_REMOTE_DEVICE_ADDRESS= -BT_REMOTE_DEVICE_NAME= -MMS_RECIPIENT_1= -MMS_RECIPIENT_2= -SMS_RECIPIENT_1= -SMS_RECIPIENT_2= -EMAIL_RECIPIENT_1= -EMAIL_RECIPIENT_2= -packageParam="false" -PACKAGE_NAME= - - -function showUsage(){ -cat << EOF -Usage: tct-testconfig.sh [...] - -p packages need to be updated.[options: tct-bluetooth-tizen-tests,tct-messaging-email-tizen-tests...] - -f Set argument of config file path. - Show usage except the above options. -E.g. - sh tct-testconfig.sh -f your-config-file - sh tct-testconfig.sh -f your-cinfig-file -p packagename1,packagename2[optional] -EOF -} - -function getParamsFromConfig(){ -if [ -n "$CONFIG_FILE" ] && [ -f "$CONFIG_FILE" ]; then - echo -n -e "\033[34mGot config file: $CONFIG_FILE\033[0m\n" - while read LINE - do - ParamName=`echo $LINE | sed 's/\(^[^=^ ]*\)[ ]*=.*$/\1/g'` - ParamValue=`echo $LINE | sed 's/\(^[^=^ ]*\)[ ]*=\(.*\)$/\2/g'` - case $ParamName in - 'BT_REMOTE_DEVICE_ADDRESS') - BT_REMOTE_DEVICE_ADDRESS=$ParamValue - ;; - 'BT_REMOTE_DEVICE_NAME') - BT_REMOTE_DEVICE_NAME=$ParamValue - ;; - 'SMS_RECIPIENT_1') - SMS_RECIPIENT_1=$ParamValue - ;; - 'SMS_RECIPIENT_2') - SMS_RECIPIENT_2=$ParamValue - ;; - 'MMS_RECIPIENT_1') - MMS_RECIPIENT_1=$ParamValue - ;; - 'MMS_RECIPIENT_2') - MMS_RECIPIENT_2=$ParamValue - ;; - 'EMAIL_RECIPIENT_1') - EMAIL_RECIPIENT_1=$ParamValue - ;; - 'EMAIL_RECIPIENT_2') - EMAIL_RECIPIENT_2=$ParamValue - ;; - * ) - ;; - esac - done < $CONFIG_FILE -else - echo -n -e "\033[31mCan't find config file: $CONFIG_FILE ...\033[0m\n" - exit -1 -fi -} - -function configBluetooth(){ - -CMD=( - "" \ - "" \ -) - -FILE_LIST=( -"/opt/usr/apps/api1bluet0/res/wgt/opt/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js" \ -"/opt/usr/apps/api1bluet0/res/wgt/opt/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js" \ -) - -CMD_LIST=( - "eval sed -i 's/var\sREMOTE\_DEVICE\_ADDRESS\s\=\s\"\([^\"]*\)\"/var\ REMOTE\_DEVICE\_ADDRESS\ =\ \"$BT_REMOTE_DEVICE_ADDRESS\"/g' FILE" \ - "eval sed -i 's/var\sREMOTE\_DEVICE\_NAME\s\=\s\"\([^\"]*\)\"/var\ REMOTE\_DEVICE\_NAME\ =\ \"$BT_REMOTE_DEVICE_NAME\"/g' FILE" \ -) - -i=0 -for iSuite in ${FILE_LIST[@]} -do - j=$i - i=`expr $i+1` - echo -n -e "\n==>> Configuring $iSuite\033[0m\n" - - CMD=${CMD_LIST[$j]/FILE/${FILE_LIST[$j]}} - echo -n -e "Config CMD: \033[34m${CMD} \033[0m\n" - - `${CMD}` - if [ $? -ne 0 ]; then - echo -n -e "\033[31mConfig ${FILE_LIST[$j]} fail ...\033[0m\n" - else - echo -n -e "\033[32mConfig ${FILE_LIST[$j]} successfully ...\033[0m\n" - fi - sync -done -} - -function configEmail(){ - -CMD=( - "" \ - "" \ -) - -FILE_LIST=( - "/opt/usr/apps/api1msg003/res/wgt/opt/tct-messaging-email-tizen-tests/messaging/support/messaging_common.js" \ - "/opt/usr/apps/api1msg003/res/wgt/opt/tct-messaging-email-tizen-tests/messaging/support/messaging_common.js" \ -) -CMD_LIST=( - "eval sed -i 's/var\sTEST\_EMAIL\_RECIPIENT\_1\s\=\s\"\([^\"]*\)\"/var\ TEST\_EMAIL\_RECIPIENT\_1\ =\ \"$EMAIL_RECIPIENT_1\"/g' FILE" \ - "eval sed -i 's/var\sTEST\_EMAIL\_RECIPIENT\_2\s\=\s\"\([^\"]*\)\"/var\ TEST\_EMAIL\_RECIPIENT\_2\ =\ \"$EMAIL_RECIPIENT_2\"/g' FILE" \ -) - -i=0 -for iSuite in ${FILE_LIST[@]} -do - j=$i - i=`expr $i+1` - echo -n -e "\n==>> Configuring $iSuite\033[0m\n" - - CMD=${CMD_LIST[$j]//FILE/${FILE_LIST[$j]}} - echo -n -e "Config CMD: \033[34m${CMD} \033[0m\n" - - `${CMD}` - if [ $? -ne 0 ]; then - echo -n -e "\033[31mConfig ${FILE_LIST[$j]} fail ...\033[0m\n" - else - echo -n -e "\033[32mConfig ${FILE_LIST[$j]} successfully ...\033[0m\n" - fi - sync -done -} - -function configMms(){ - -CMD=( - "" \ - "" \ -) - -FILE_LIST=( - "/opt/usr/apps/api1msg002/res/wgt/opt/tct-messaging-mms-tizen-tests/messaging/support/messaging_common.js" \ - "/opt/usr/apps/api1msg002/res/wgt/opt/tct-messaging-mms-tizen-tests/messaging/support/messaging_common.js" \ -) -CMD_LIST=( - "eval sed -i 's/var\sTEST\_SMS\_RECIPIENT\s\=\s\"\([^\"]*\)\"/var\ TEST\_SMS\_RECIPIENT\ =\ \"$MMS_RECIPIENT_1\"/g' FILE" \ - "eval sed -i 's/var\sTEST\_SMS\_RECIPIENT\_2\s\=\s\"\([^\"]*\)\"/var\ TEST\_SMS\_RECIPIENT\_2\ =\ \"$MMS_RECIPIENT_2\"/g' FILE" \ -) - -i=0 -for iSuite in ${FILE_LIST[@]} -do - j=$i - i=`expr $i+1` - echo -n -e "\n==>> Configuring $iSuite\033[0m\n" - - CMD=${CMD_LIST[$j]//FILE/${FILE_LIST[$j]}} - echo -n -e "Config CMD: \033[34m${CMD} \033[0m\n" - - `${CMD}` - if [ $? -ne 0 ]; then - echo -n -e "\033[31mConfig ${FILE_LIST[$j]} fail ...\033[0m\n" - else - echo -n -e "\033[32mConfig ${FILE_LIST[$j]} successfully ...\033[0m\n" - fi - sync -done -} - -function configSms(){ - -CMD=( - "" \ - "" \ -) - -FILE_LIST=( - "/opt/usr/apps/api1msg001/res/wgt/opt/tct-messaging-sms-tizen-tests/messaging/support/messaging_common.js" \ - "/opt/usr/apps/api1msg001/res/wgt/opt/tct-messaging-sms-tizen-tests/messaging/support/messaging_common.js" \ -) -CMD_LIST=( - "eval sed -i 's/var\sTEST\_SMS\_RECIPIENT\s\=\s\"\([^\"]*\)\"/var\ TEST\_SMS\_RECIPIENT\ =\ \"$SMS_RECIPIENT_1\"/g' FILE" \ - "eval sed -i 's/var\sTEST\_SMS\_RECIPIENT\_2\s\=\s\"\([^\"]*\)\"/var\ TEST\_SMS\_RECIPIENT\_2\ =\ \"$SMS_RECIPIENT_2\"/g' FILE" \ -) - -i=0 -for iSuite in ${FILE_LIST[@]} -do - j=$i - i=`expr $i+1` - echo -n -e "\n==>> Configuring $iSuite\033[0m\n" - - CMD=${CMD_LIST[$j]//FILE/${FILE_LIST[$j]}} - echo -n -e "Config CMD: \033[34m${CMD} \033[0m\n" - - `${CMD}` - if [ $? -ne 0 ]; then - echo -n -e "\033[31mConfig ${FILE_LIST[$j]} fail ...\033[0m\n" - else - echo -n -e "\033[32mConfig ${FILE_LIST[$j]} successfully ...\033[0m\n" - fi - sync -done -} - -function getPackage(){ - if [ -n "$PACKAGE_NAME" ]; then - #PackageName=($PACKAGE_NAME) - PackageName=(${PACKAGE_NAME//,/ }) - if [ ${#PackageName[*]} -lt 3 ]; then - for pname in ${PackageName[@]} - do - case $pname in - 'tct-bluetooth-tizen-tests') - configBluetooth; - ;; - 'tct-messaging-email-tizen-tests') - configEmail; - ;; - 'tct-messaging-mms-tizen-tests') - configMms; - ;; - 'tct-messaging-sms-tizen-tests') - configSms; - ;; - 'tct-geoallow-w3c-tests') - ConfigGeo; - ;; - 'tct-geodeny-w3c-tests') - ConfigGeo; - ;; - * ) - echo "fail, error package name:$pname"; - exit -1 - ;; - esac - done - else - showUsage; - exit -1 - fi - else - showUsage; - exit -1 - fi -} - -function ConfigGeo(){ - su -c "vconftool set -t int db/location/replay/ReplayEnabled 1 -f" - echo "Config geolocation successfully..." -} - -while getopts "f:p:" arg -do - case $arg in - f) - CONFIG_FILE=$OPTARG; - ;; - p) - packageParam="true"; - PACKAGE_NAME=$OPTARG; - ;; - ?) - showUsage; - exit -1 - ;; - esac -done - -if [ "$packageParam" = "false" ] && [ -n "$CONFIG_FILE" ]; then - getParamsFromConfig; - configBluetooth; - configEmail; - configMms; - configSms; - ConfigGeo; - exit 0 -elif [ "$packageParam" = "true" ] && [ -n "$CONFIG_FILE" ]; then - getParamsFromConfig; - getPackage; - exit 0 -else - showUsage; - exit -1 -fi