fix performance_test for tizen 3.0 mobile/wearable 40/108040/2
authorInhwan Lee <ideal.lee@samsung.com>
Mon, 2 Jan 2017 11:48:10 +0000 (20:48 +0900)
committerInhwan Lee <ideal.lee@samsung.com>
Tue, 3 Jan 2017 04:28:02 +0000 (13:28 +0900)
appfw change policy about global application.
so performance test enable in various version for dotnet

Change-Id: I70bc78281d2b5718ddd9e55946e0ec54d4911e69

tools/performance_test.sh
tools/timestamp.sh

index def3105..fa42f79 100755 (executable)
@@ -5,11 +5,16 @@ DATE=$(date +%Y%m%d_%H%M)
 RESULT_LOG_FILE='result/result_'$DATE'.log'
 
 WAIT_FOR_LAUNCH=10
+WAIT_FOR_LONG_LAUNCH=30
 WAIT_FOR_KILL=5
 
 PKG_IDS=()
 APP_IDS=()
 
+LONG_LAUNCHING_APP=(
+    "org.tizen.example.SNSUI.Tizen",
+)
+
 initialize ()
 {
     echo ""
@@ -55,11 +60,14 @@ install_tpk ()
 
     for item in ${TPKS[*]}
     do
-        INSTALL_MSG=$(sdb install tpk/$item | grep start)
-        INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\[/ /g")
-        INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\]/ /g")
-        PKG_IDS+=($(echo $INSTALL_MSG | awk '{print $7}'))
-        echo " [>] ($(echo $INSTALL_MSG | awk '{print $7}')) installs complete"
+#        INSTALL_MSG=$(sdb install tpk/$item | grep start)
+#        INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\[/ /g")
+#        INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\]/ /g")
+#        PKG_IDS+=($(echo $INSTALL_MSG | awk '{print $7}'))
+        INSTALL_PKG=$(sdb install tpk/$item | grep start  | sed "s/\[/ /g" | sed "s/\]/ /g" | awk '{print $7}' | tr -d '\r')
+        PKG_IDS+=$INSTALL_PKG
+        #($(echo $INSTALL_PKG)
+        echo " [>]  $INSTALL_PKG installs complete"
     done
 }
 
@@ -77,7 +85,19 @@ get_current_tpk_apps ()
             then
                 echo $APP_LIST_ENTITY | awk '{print $6}'
             fi
-        done | sort
+        done | sort | tr -d '\r'
+    )
+#In 3.0 mobile / wearable, appfw install all of application to global application
+    PKG_IDS+=$(
+        sdb shell "su - owner -c 'ls -al /opt/usr/globalapps/ | grep tizenglobalapp'" |  while read line
+        do
+            APP_LIST_ENTITY=$line
+            APP_GLOBAL=($(echo $APP_LIST_ENTITY | awk '{print $3}'))
+            if [[ $APP_GLOBAL == 'tizenglobalapp' ]]
+            then
+                echo $APP_LIST_ENTITY | awk '{print $9}'
+            fi
+        done | sort | tr -d '\r'
     )
 }
 
@@ -87,10 +107,8 @@ make_appid_list ()
     echo "[>] Get application id that installed"
     for item in ${PKG_IDS[*]}
     do
-        APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -l | grep $item'")
-        APP_LIST_MSG=${APP_LIST_MSG#*\'}
-        APP_LIST_MSG=$(echo $APP_LIST_MSG | sed "s/'/ /g")
-        APP_IDS+=($(echo $APP_LIST_MSG | awk '{print $2}'))
+        APP_LIST_MSG=$(sdb shell "su - owner -c 'pkginfo --pkg $item' | grep mainappid" | tail -1)
+        APP_IDS+=($(echo $APP_LIST_MSG | awk '{print $3}' | tr -d '\r'))
     done
 }
 
@@ -106,7 +124,7 @@ initialize_first_launch ()
     echo "[>] Initial launch an application"
     APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -s ${APP_IDS[0]}'")
     sleep 10
-    APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -k ${APP_IDS[0]}'")
+    APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -t ${APP_IDS[0]}'")
     sleep 5
 }
 
@@ -169,8 +187,12 @@ execute_all_app ()
     for item in ${APP_IDS[*]}
     do
         APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -s $item'")
-        sleep $WAIT_FOR_LAUNCH
-        APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -k $item'")
+        if [[ "${LONG_LAUNCHING_APP[@]}" =~ "${item}" ]]; then
+            sleep $WAIT_FOR_LONG_LAUNCH
+        else
+            sleep $WAIT_FOR_LAUNCH
+        fi
+        APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -t $item'")
         sleep $WAIT_FOR_KILL
     done
 }
@@ -281,5 +303,4 @@ then
     finalize
 else
     help
-fi
-
+fi
\ No newline at end of file
index 57923a7..8d94aad 100755 (executable)
@@ -13,11 +13,17 @@ IS_START=false
 echo -e "T(ms)\tAPP ID" | tee -a $RESULT_FILE
 while inotifywait -qqre modify "$LOG_FILE"; do
     GET_LOG="$(tail -1 $LOG_FILE)"
-    GET_LOG=$(echo $GET_LOG | sed "s/(/ /g")
+    GET_LOG=$(echo $GET_LOG | sed "s/(/ /g" | sed "s/)/ /g")
     if [[ $GET_LOG == *"app_request_to_launchpad_for_uid"* ]];
     then
-        APP_NAME=$(echo "$GET_LOG" | grep app_request_to_launchpad_for_uid | awk '{print $13}')
-        APP_NAME=$(echo $APP_NAME | tr -d '\r')
+        GET_LOG=$(echo $GET_LOG | tr -d '\r')
+        if [[ $GET_LOG == *target_uid* ]];
+        then
+            APP_NAME=$(echo "$GET_LOG" | grep app_request_to_launchpad_for_uid | awk '{print $15}')
+        else
+            APP_NAME=$(echo "$GET_LOG" | grep app_request_to_launchpad_for_uid | awk '{print $14}')
+        fi
+
         IS_DIGIT=$(echo $APP_NAME | sed "s/[^0-9]*//g")
 
         if [[ $IS_DIGIT != $APP_NAME ]];