Fixed bug TTS-1814 to modify the Common file in scripts folder.
authorgex.zhang <gex.zhang@intel.com>
Mon, 29 Jul 2013 09:00:20 +0000 (02:00 -0700)
committergex.zhang <gex.zhang@intel.com>
Mon, 29 Jul 2013 09:00:20 +0000 (02:00 -0700)
Change-Id: I79dc2598017f7905638a131dd91c99f04f27935d
Signed-off-by: gex.zhang <gex.zhang@intel.com>
tct-pm-wrt-tests/scripts/Common

index 10e3b77769613dc52b13402dfd774d36e7216f04..6e91e3bc120ee509aedbe472736390edd7799e54 100644 (file)
@@ -31,7 +31,7 @@ function func_install()
     p_name=$1
     APP_NAME=${p_name%.*}
     wrt-installer -i $PACKAGENAME
-    App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     if [ -z $App_ID ];then
       echo "The installation is failed"
       return 1
@@ -51,19 +51,19 @@ function func_uninstall()
     PACKAGENAME="$path/$1"
     p_name=$1
     APP_NAME=${p_name%.*}
-    App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     if [ -z $App_ID ];then
       echo "The widget is not installed"
       wrt-installer -i $PACKAGENAME
-      App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+      App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
       if [ -z $App_ID ];then
         echo "The installation is failed"
         return 1
       fi
     fi
-    WIDGETNAME=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    WIDGETNAME=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     wrt-installer -un $WIDGETNAME
-    App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     if [ -z $App_ID ];then
       echo "The widget is uninstalled successfully"
       return 0
@@ -83,7 +83,7 @@ function func_launch()
     PACKAGENAME="$path/$1"
     p_name=$1
     APP_NAME=${p_name%.*}
-    WIDGETNAME=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    WIDGETNAME=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     wrt-launcher -s $WIDGETNAME
     App_Status=`wrt-launcher -r $WIDGETNAME | grep "not running"`
     if [ -z $App_Status ];then
@@ -117,7 +117,7 @@ function func_install_changename()
         APP_NAME="WIdgetIDAppID"
     fi
     wrt-installer -i $PACKAGENAME
-    App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     if [ -z $App_ID ];then
       echo "The installation is failed"
       return 1
@@ -148,19 +148,19 @@ function func_uninstall_changename()
     elif [ "$APP_NAME" = "WIdgetIDAppID-same1" -o "$APP_NAME" = "WIdgetIDAppID-same2" -o "$APP_NAME" = "WIdgetIDAppID-different" ];then
         APP_NAME="WIdgetIDAppID"
     fi
-    App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     if [ -z $App_ID ];then
       echo "The widget is not installed"
       wrt-installer -i $PACKAGENAME
-      App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+      App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
       if [ -z $App_ID ];then
         echo "The installation is failed"
         return 1
       fi
     fi
-    WIDGETNAME=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    WIDGETNAME=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     wrt-installer -un $WIDGETNAME
-    App_ID=`wrt-launcher -l|grep $APP_NAME|awk '{print $NF}'`
+    App_ID=`wrt-launcher -l|grep -w $APP_NAME|awk '{print $NF}'`
     if [ -z $App_ID ];then
       echo "The widget is uninstalled successfully"
       return 0