- change path for supporting global user in inst.wgt.py, .sh scripts and tests.xml
Change-Id: If762f5df2bf0ebdff79f2f4b37bba7db4459d236
Signed-off-by: wei.ji <wei.ji@samsung.com>
import sys
import subprocess
import string
-from optparse import OptionParser, make_option\r
+from optparse import OptionParser, make_option
import ConfigParser
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
+EXECUTION_MODE_30 = tct_parser.get('DEVICE', 'DEVICE_EXECUTION_MODE_30')
+ADMIN_USER_30 = tct_parser.get('DEVICE', 'DEVICE_ADMIN_USER_30')
+
+def userCheck():
+ global GLOVAL_OPT
+ if ADMIN_USER_30 == EXECUTION_MODE_30:
+ GLOVAL_OPT="--global"
+ else:
+ GLOVAL_OPT=""
def doCMD(cmd):
action_status = False
continue
(return_code, output) = doRemoteCMD(
- "pkgcmd -u -t wgt -q -n %s" % pkg_id)
+ "pkgcmd %s -q -u -n %s" % (GLOVAL_OPT, pkg_id))
for line in output:
if "Failure" in line:
action_status = False
# if not doRemoteCopy(os.path.join(root, file), "%s/%s" % (SRC_DIR, file)):
# action_status = False
# (return_code, output) = doRemoteCMD(
-# "pkgcmd -i -t wgt -q -p %s/%s" % (SRC_DIR, file))
+# "pkgcmd %s -i -t wgt -q -p %s/%s" % (GLOVAL_OPT, SRC_DIR, file))
# doRemoteCMD("rm -rf %s/%s" % (SRC_DIR, file))
# for line in output:
# if "Failure" in line:
sys.exit(1)
if not PARAMETERS.user:
- PARAMETERS.user = "owner"
+ PARAMETERS.user = EXECUTION_MODE_30
if not PARAMETERS.mode:
PARAMETERS.mode = "SDB"
if not PARAMETERS.device:
print "No device provided"
sys.exit(1)
-
+
+ userCheck()
+
user_info = getUSERID()
re_code = user_info[0]
if re_code == 0 :
exit 1
fi
fi
+echo $PACKAGENAME
+echo $PACKAGENAME
+echo $PACKAGENAME
install_app $PACKAGENAME
find_app $APP_NAME
pkgnum=`echo "$pkgids"|wc -w`
#
# Authors:
# Zhang Ge <gex.zhang@intel.com>
-
+TCT_CONFIG_FILE=/tmp/TCT_CONFIG
+if [ ! -f $TCT_CONFIG_FILE ];then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "$TCT_CONFIG_FILE is not Found : Can Not Read TCT Configuration Directory"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+ADMIN_USER_30=`cat $TCT_CONFIG_FILE | grep DEVICE_ADMIN_USER_30 | cut -f 2- -d '='`
+if [[ $ADMIN_USER_30 == "" ]]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_ADMIN_USER_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+DEVICE_SUITE_TARGET_30=`cat $TCT_CONFIG_FILE | grep DEVICE_SUITE_TARGET_30 | cut -f 2- -d '='`
+if [ $DEVICE_SUITE_TARGET_30 == "" ]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_SUITE_TARGET_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+DEVICE_PHYSICAL_STORAGE_30=`cat $TCT_CONFIG_FILE | grep DEVICE_PHYSICAL_STORAGE_30 | cut -f 2- -d '='`
+if [ $DEVICE_PHYSICAL_STORAGE_30 == "" ]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_PHYSICAL_STORAGE_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+DEVICE_USER_30=`cat $TCT_CONFIG_FILE | grep DEVICE_USER_30 | cut -f 2- -d '='`
+if [[ $DEVICE_USER_30 == "" ]]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_USER_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+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 ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_EXECUTION_MODE_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+if [[ "$DEVICE_EXECUTION_MODE_30" == "$ADMIN_USER_30" ]]; then
+APPS_ROOT=`cat $TCT_CONFIG_FILE | grep DEVICE_ADMIN_USER_APPS_ROOT_30 | cut -f 2- -d '='`
+GLOBAL_OPT="--global"
+else
+APPS_ROOT=`cat $TCT_CONFIG_FILE | grep DEVICE_OTHER_USER_APPS_ROOT_30 | cut -f 2- -d '='`
+GLOBAL_OPT=""
+fi
+echo "ADMIN_USER_30 = $ADMIN_USER_30"
+echo "APPS_ROOT = $APPS_ROOT"
+if [ $APPS_ROOT == "" ]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_ADMIN(or OTHER)_USER_APPS_ROOT_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
path=$(dirname $(dirname $0))
source $path/scripts/xwalk_common.sh
APP_NAME="private_localstorage_check"
echo "Failed to get appid."
exit 1
fi
-widgetpath="/home/owner/apps_rw/$pkgids/res/wgt"
+widgetpath="$APPS_ROOT/$pkgids/res/wgt"
+echo $widgetpath
+echo $widgetpath
+echo $widgetpath
if [ ! -d $widgetpath ]
then
existbh "The path of the application does not exist." 1
#Authors:
# Lin, Wanming <wanmingx.lin@intel.com>
-
+TCT_CONFIG_FILE=/tmp/TCT_CONFIG
+if [ ! -f $TCT_CONFIG_FILE ];then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "$TCT_CONFIG_FILE is not Found : Can Not Read TCT Configuration Directory"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+ADMIN_USER_30=`cat $TCT_CONFIG_FILE | grep DEVICE_ADMIN_USER_30 | cut -f 2- -d '='`
+if [[ $ADMIN_USER_30 == "" ]]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_ADMIN_USER_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+DEVICE_SUITE_TARGET_30=`cat $TCT_CONFIG_FILE | grep DEVICE_SUITE_TARGET_30 | cut -f 2- -d '='`
+if [ $DEVICE_SUITE_TARGET_30 == "" ]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_SUITE_TARGET_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+DEVICE_PHYSICAL_STORAGE_30=`cat $TCT_CONFIG_FILE | grep DEVICE_PHYSICAL_STORAGE_30 | cut -f 2- -d '='`
+if [ $DEVICE_PHYSICAL_STORAGE_30 == "" ]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_PHYSICAL_STORAGE_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+DEVICE_USER_30=`cat $TCT_CONFIG_FILE | grep DEVICE_USER_30 | cut -f 2- -d '='`
+if [[ $DEVICE_USER_30 == "" ]]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_USER_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+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 ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_EXECUTION_MODE_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
+if [[ "$DEVICE_EXECUTION_MODE_30" == "$ADMIN_USER_30" ]]; then
+APPS_ROOT=`cat $TCT_CONFIG_FILE | grep DEVICE_ADMIN_USER_APPS_ROOT_30 | cut -f 2- -d '='`
+GLOBAL_OPT="--global"
+else
+APPS_ROOT=`cat $TCT_CONFIG_FILE | grep DEVICE_OTHER_USER_APPS_ROOT_30 | cut -f 2- -d '='`
+GLOBAL_OPT=""
+fi
+echo "ADMIN_USER_30 = $ADMIN_USER_30"
+echo "APPS_ROOT = $APPS_ROOT"
+if [ $APPS_ROOT == "" ]; then
+ echo ""
+ echo "****************FATAL ERROR : inst.sh***************************"
+ echo "'DEVICE_ADMIN(or OTHER)_USER_APPS_ROOT_30' key-value pair is not Found"
+ echo "$PKG_NAME : INSTALLATION/UNINSTALLATION Can Not Proceed"
+ echo "********************************************************************"
+ echo ""
+ return;
+fi
###below functions just for crosswalk ivi testing###
-##usage: install_app $app_path(e.g. uninstall_app /home/owner/share/tct/opt/tct-sp02-wrt-tests/tct-sp02-wrt-tests.wgt)##
+##usage: install_app $app_path(e.g. admin user: install_app /home/usr/globalapps/tct/opt/tct-sp02-wrt-tests/tct-sp02-wrt-tests.wgt
+ ##local user: install_app /home/{user}/apps_rw/tct/opt/tct-sp02-wrt-tests/tct-sp02-wrt-tests.wgt)##
function install_app(){
- pkgcmd -i -t wgt -q -p $1
+ pkgcmd $GLOBAL_OPT -i -t wgt -q -p $1
}
##usage: uninstall_app $app_name(e.g. uninstall_app tct-sp02-wrt-tests)##
pkgids=`pkgcmd -l |grep $1 |awk -F "pkgid" '{print $2}' |awk -F '[' '{print $2}'|awk -F ']' '{print $1}'`
for pkgid in $pkgids
do
- pkgcmd -u -n $pkgid -q
+ pkgcmd $GLOBAL_OPT -u -n $pkgid -q
done
}
<expected>Application has its own localStorage space.</expected>
</step>
</steps>
- <test_script_entry test_script_expected_result="0">owner_user@/home/owner/share/tct/opt/tct-sp02-wrt-tests/scripts/wrt_sp02_localstorage_check.sh</test_script_entry>
+ <test_script_entry test_script_expected_result="0">{DEVICE_EXECUTION_MODE_30}_user@{DEVICE_SUITE_TARGET_30}/tct/opt/tct-sp02-wrt-tests/scripts/wrt_sp02_localstorage_check.sh</test_script_entry>
<notes />
</description>
<specs>
<set name="SecurityPrivacy" type="script">
<testcase component="Tizen WRT Core Spec/Security Privacy" execution_type="auto" id="private_localstorage_check" purpose="Check that Application has its own localStorage space.">
<description>
- <test_script_entry test_script_expected_result="0">owner_user@/home/owner/share/tct/opt/tct-sp02-wrt-tests/scripts/wrt_sp02_localstorage_check.sh</test_script_entry>
+ <test_script_entry test_script_expected_result="0">{DEVICE_EXECUTION_MODE_30}_user@{DEVICE_SUITE_TARGET_30}/tct/opt/tct-sp02-wrt-tests/scripts/wrt_sp02_localstorage_check.sh</test_script_entry>
</description>
</testcase>
</set>