cp templates/external_wrapper_asan/external_wrapper.sh /tmp/$TCT_DIR/
else
if [ $INSTALL_MODE == 0 ]; then
- cp templates/external_wrapper_execution/external_wrapper.sh /tmp/$TCT_DIR/
+ if [[ $MOD_NAME == *"dali"* ]]; then
+ cp templates/external_wrapper_non_single_process/external_wrapper.sh /tmp/$TCT_DIR/
+ else
+ cp templates/external_wrapper_execution/external_wrapper.sh /tmp/$TCT_DIR/
+ fi
elif [ $INSTALL_MODE == 1 ]; then
cp templates/external_wrapper_coverage/external_wrapper.sh /tmp/$TCT_DIR/
else
cp templates/external_wrapper_asan/external_wrapper.sh /tmp/$TCT_DIR/
else
if [ $INSTALL_MODE == 0 ]; then
- cp templates/external_wrapper_execution/external_wrapper.sh /tmp/$TCT_DIR/
+ if [[ $MOD_NAME == *"dali"* ]]; then
+ cp templates/external_wrapper_non_single_process/external_wrapper.sh /tmp/$TCT_DIR/
+ else
+ cp templates/external_wrapper_execution/external_wrapper.sh /tmp/$TCT_DIR/
+ fi
elif [ $INSTALL_MODE == 1 ]; then
cp templates/external_wrapper_coverage/external_wrapper.sh /tmp/$TCT_DIR/
else
--- /dev/null
+
+
+#!/bin/bash
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http:#www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+TIMEOUT_VALUE=60 #default timeout value
+FILE="/tmp/TC_Timeout.txt"
+# extract TCT configuration directory from TCT_CONFIG_FILE (/tmp/TCT_CONFIG)
+TCT_CONFIG_FILE=/tmp/TCT_CONFIG
+if [ ! -f $TCT_CONFIG_FILE ];then
+ echo "$TCT_CONFIG_FILE is not Found : Can Not Read TCT Configuration File to get Execution Mode"
+ exit 1;
+fi
+DEVICE_EXECUTION_MODE_30=`cat $TCT_CONFIG_FILE | grep DEVICE_EXECUTION_MODE_30 | cut -f 2- -d '='`
+if [ $DEVICE_EXECUTION_MODE_30 == "" ]; then
+ echo "'DEVICE_EXECUTION_MODE_30' key-value pair is not Found in $TCT_CONFIG_FILE. Unable to get Execution Mode"
+ exit 1;
+fi
+
+if [[ "$1" == "" || "$2" == "" || "$3" == "" ]];
+then
+ echo "module name, TC name and build type type needed"
+ exit 1
+fi
+
+TIME_FACTOR=10
+RESULT_PATH=/tmp/tcresult
+ERRLOG_PATH=/tmp/tclog
+UTC_LOG_CORE=/tmp/utclog_core
+
+#Read timeout value from /tmp/TCT_Timeout.txt file
+if [ -f $FILE ];
+then
+ for next in `cat $FILE`
+ do
+ TIMEOUT_VALUE=$next
+ done
+fi
+
+function KillPackage {
+ pkgcmd --kill -n $1
+ sleep 2
+}
+
+
+function Execute {
+ rm -f $RESULT_PATH
+ rm -f $ERRLOG_PATH
+ rm -f $UTC_LOG_CORE
+
+ RET=`su -c "app_launcher -s $1 testcase_name $2" $DEVICE_EXECUTION_MODE_30`
+ if [[ $RET != *"successfully launched"* ]];then
+ su -c "app_launcher -k $1 > /dev/null" $DEVICE_EXECUTION_MODE_30
+ exit 1
+ fi
+
+ COUNTER=0
+ i=0
+ TIME_OUT=0
+ while [ ! -e $RESULT_PATH ];
+ do
+ if [ $COUNTER -eq $TIMEOUT_VALUE ];
+ then
+ TIME_OUT=1
+ break
+ fi
+ for i in {1..20}
+ do
+ sleep 0.1
+ RE=`su -c "app_launcher -r $1 " $DEVICE_EXECUTION_MODE_30`
+ if [[ $RE == *"result: running"* ]];then
+ continue
+ else
+ break
+ fi
+ done
+ COUNTER=$(($COUNTER + 2))
+ done
+
+ su -c "app_launcher -k $1 > /dev/null" $DEVICE_EXECUTION_MODE_30
+ for i in {1..100}
+ do
+ sleep 0.1
+ RE=`su -c "app_launcher -r $1 " $DEVICE_EXECUTION_MODE_30`
+ if [[ $RE == *"result: running"* ]];then
+ continue
+ else
+ break
+ fi
+ done
+
+ if [ -e $ERRLOG_PATH ];
+ then
+ echo `cat $ERRLOG_PATH`
+ rm -f $ERRLOG_PATH
+ fi
+ if [ -e $UTC_LOG_CORE ];
+ then
+ echo `cat $UTC_LOG_CORE`
+ rm -f $UTC_LOG_CORE
+ fi
+ if [[ $TIME_OUT == "1" ]];
+ then
+ exit 1
+ fi
+
+ exit `cat $RESULT_PATH`
+}
+
+
+Execute $1 $2
sys.exit('Aborting...')
# external_wrapper.sh
- shutil.copy('scripts_tpk'+dirSeparator+'external_wrapper.sh', dirSeparator+'tmp'+dirSeparator+TCT_DIR)
+ process = "dali"
+ if ( re.search(process, MODNAME) != None ):
+ shutil.copy('scripts_tpk'+dirSeparator+'external_wrapper_non_single_process.sh', dirSeparator+'tmp'+dirSeparator+TCT_DIR+dirSeparator+'external_wrapper.sh')
+ else:
+ shutil.copy('scripts_tpk'+dirSeparator+'external_wrapper.sh', dirSeparator+'tmp'+dirSeparator+TCT_DIR)
# LICENSE, add_all_smack_rule.sh, all_smack.rule
shutil.copy('scripts_tpk'+dirSeparator+'LICENSE', dirSeparator+'tmp'+dirSeparator+TCT_DIR)
sys.exit('Aborting...')
# external_wrapper.sh
- shutil.copy('scripts_tpk'+dirSeparator+'external_wrapper.sh', dirSeparator+'tmp'+dirSeparator+TCT_DIR)
+ process = "dali"
+ if ( re.search(process, MODNAME) != None ):
+ shutil.copy('scripts_tpk'+dirSeparator+'external_wrapper_non_single_process.sh', dirSeparator+'tmp'+dirSeparator+TCT_DIR+dirSeparator+'external_wrapper.sh')
+ else:
+ shutil.copy('scripts_tpk'+dirSeparator+'external_wrapper.sh', dirSeparator+'tmp'+dirSeparator+TCT_DIR)
# LICENSE, add_all_smack_rule.sh, all_smack.rule
shutil.copy('scripts_tpk'+dirSeparator+'LICENSE', dirSeparator+'tmp'+dirSeparator+TCT_DIR)
--- /dev/null
+
+
+#!/bin/bash
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http:#www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+TIMEOUT_VALUE=60 #default timeout value
+FILE="/tmp/TC_Timeout.txt"
+UTC_LOG_CORE=/tmp/utclog_core
+SCRIPT_DIR="/home/owner/share"
+
+# extract TCT configuration directory from TCT_CONFIG_FILE (/tmp/TCT_CONFIG)
+TCT_CONFIG_FILE=/tmp/TCT_CONFIG
+if [ ! -f $TCT_CONFIG_FILE ];then
+ echo "$TCT_CONFIG_FILE is not Found : Can Not Read TCT Configuration File to get Execution Mode"
+ exit 1;
+fi
+DEVICE_EXECUTION_MODE_30=`cat $TCT_CONFIG_FILE | grep DEVICE_EXECUTION_MODE_30 | cut -f 2- -d '='`
+if [ $DEVICE_EXECUTION_MODE_30 == "" ]; then
+ echo "'DEVICE_EXECUTION_MODE_30' key-value pair is not Found in $TCT_CONFIG_FILE. Unable to get Execution Mode"
+ exit 1;
+fi
+
+if [[ "$1" == "" || "$2" == "" || "$3" == "" ]];
+then
+ echo "module name, TC name and build type type needed"
+ exit 1
+fi
+
+#Read timeout value from /tmp/TCT_Timeout.txt file
+
+if [ -f $FILE ];
+then
+ for next in `cat $FILE`
+ do
+ TIMEOUT_VALUE=$next
+ done
+fi
+
+
+function Execute {
+ RESULT_PATH=/tmp/tcresult
+ ERRLOG_PATH=/tmp/tclog
+ rm -f $RESULT_PATH
+ rm -f $ERRLOG_PATH
+ rm -f $UTC_LOG_CORE
+
+ ## pre-launch script
+ if [ -f $SCRIPT_DIR/pre_launch.sh ];
+ then
+ bash $SCRIPT_DIR/pre_launch.sh $1 $3 $2
+ fi
+
+ RET=`su -c "app_launcher -s native.$1-$3 testcase_name $2" $DEVICE_EXECUTION_MODE_30`
+ if [[ $RET == *"successfully launched"* ]];then
+ echo "Successfully Launched"
+
+ ## post-launch script
+ if [ -f $SCRIPT_DIR/post_launch.sh ];
+ then
+ bash $SCRIPT_DIR/post_launch.sh $1 $3 $2
+ fi
+
+ else
+ echo "Launch Failed"
+ su -c "app_launcher -t native.$1-$3 > /dev/null" $DEVICE_EXECUTION_MODE_30
+ exit 1
+ fi
+
+ COUNTER=0
+ i=0
+ TIME_OUT=0
+ while [ ! -e $RESULT_PATH ];
+ do
+ if [ $COUNTER -eq $TIMEOUT_VALUE ];
+ then
+ TIME_OUT=1
+ break
+ fi
+ for i in {1..20}
+ do
+ sleep 0.1
+ RE=`su -c "app_launcher -r native.$1-$3 " $DEVICE_EXECUTION_MODE_30`
+ if [[ $RE == *"result: running"* ]];then
+ continue
+ else
+ break
+ fi
+ done
+ COUNTER=$(($COUNTER + 2))
+ done
+
+ su -c "app_launcher -k native.$1-$3 > /dev/null" $DEVICE_EXECUTION_MODE_30
+ for i in {1..100}
+ do
+ sleep 0.1
+ RE=`su -c "app_launcher -r native.$1-$3 " $DEVICE_EXECUTION_MODE_30`
+ if [[ $RE == *"result: running"* ]];then
+ continue
+ else
+ break
+ fi
+ done
+
+ if [ -e $ERRLOG_PATH ];
+ then
+ echo `cat $ERRLOG_PATH`
+ rm -f $ERRLOG_PATH
+ fi
+ if [ -e $UTC_LOG_CORE ];
+ then
+ echo `cat $UTC_LOG_CORE`
+ rm -f $UTC_LOG_CORE
+ fi
+ if [[ $TIME_OUT == "1" ]];
+ then
+ exit 1
+ fi
+
+ exit `cat $RESULT_PATH`
+}
+
+function ExecuteUTC {
+ RESULT_PATH=/tmp/tcresult
+ ERRLOG_PATH=/tmp/utclog
+ rm -f $RESULT_PATH
+ rm -f $ERRLOG_PATH
+ rm -f $UTC_LOG_CORE
+
+ ## pre-launch script
+ if [ -f $SCRIPT_DIR/pre_launch.sh ];
+ then
+ bash $SCRIPT_DIR/pre_launch.sh $1 "utc" $2
+ fi
+
+ RET=`su -c "app_launcher -s core.$1-tests testcase_name $2" $DEVICE_EXECUTION_MODE_30`
+ if [[ $RET == *"successfully launched"* ]];then
+ echo "Successfully Launched"
+
+ ## post-launch script
+ if [ -f $SCRIPT_DIR/post_launch.sh ];
+ then
+ bash $SCRIPT_DIR/post_launch.sh $1 "utc" $2
+ fi
+
+ else
+ echo "Launch Failed"
+ su -c "app_launcher -t core.$1-tests > /dev/null" $DEVICE_EXECUTION_MODE_30
+ exit 1
+ fi
+ COUNTER=0
+ i=0
+ TIME_OUT=0
+ while [ ! -e $RESULT_PATH ];
+ do
+ if [ $COUNTER -eq $TIMEOUT_VALUE ];
+ then
+ TIME_OUT=1
+ break
+ fi
+ for i in {1..20}
+ do
+ sleep 0.1
+ RE=`su -c "app_launcher -r core.$1-tests " $DEVICE_EXECUTION_MODE_30`
+ if [[ $RE == *"result: running"* ]];then
+ continue
+ else
+ break
+ fi
+ done
+ COUNTER=$(($COUNTER + 2))
+ done
+
+ su -c "app_launcher -k native.$1-$3 > /dev/null" $DEVICE_EXECUTION_MODE_30
+ for i in {1..100}
+ do
+ sleep 0.1
+ RE=`su -c "app_launcher -r native.$1-$3 " $DEVICE_EXECUTION_MODE_30`
+ if [[ $RE == *"result: running"* ]];then
+ continue
+ else
+ break
+ fi
+ done
+
+ if [ -e $ERRLOG_PATH ];
+ then
+ echo `cat $ERRLOG_PATH`
+ rm -f $ERRLOG_PATH
+ fi
+ if [ -e $UTC_LOG_CORE ];
+ then
+ echo `cat $UTC_LOG_CORE`
+ rm -f $UTC_LOG_CORE
+ fi
+ if [[ $TIME_OUT == "1" ]];
+ then
+ exit 1
+ fi
+ exit `cat $RESULT_PATH`
+}
+
+if [[ $3 == "itc" ]] || [[ $3 == "ctc" ]] ;then
+ Execute $1 $2 $3
+else
+ ExecuteUTC $1 $2
+fi
+
+
+
+
+
+