From: w.gu Date: Fri, 20 Jan 2017 12:04:55 +0000 (+0800) Subject: [mobile, wearable][playerutil][change path for supporting global user] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94243dc0ac1810cd94d4ff5026014fe6dfd72737;p=test%2Ftct%2Fweb%2Fapi.git [mobile, wearable][playerutil][change path for supporting global user] Change-Id: I11d74b070c0e5777f81ea52f5f034fbda106b64e Signed-off-by: w.gu --- diff --git a/mobile/tct-playerutil-tizen-tests/inst.wgt.py b/mobile/tct-playerutil-tizen-tests/inst.wgt.py index 5b1718da1..c7f89fd44 100644 --- a/mobile/tct-playerutil-tizen-tests/inst.wgt.py +++ b/mobile/tct-playerutil-tizen-tests/inst.wgt.py @@ -7,7 +7,7 @@ import time import sys import subprocess import string -from optparse import OptionParser, make_option +from optparse import OptionParser, make_option import ConfigParser @@ -20,7 +20,16 @@ tct_parser = ConfigParser.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): # Do not need handle timeout in this short script, let tool do it @@ -116,7 +125,7 @@ def uninstPKGs(): 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 @@ -145,7 +154,7 @@ def instPKGs(): 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: @@ -187,7 +196,7 @@ def main(): sys.exit(1) if not PARAMETERS.user: - PARAMETERS.user = "owner" + PARAMETERS.user = EXECUTION_MODE_30 if not PARAMETERS.mode: PARAMETERS.mode = "SDB" @@ -204,7 +213,9 @@ def main(): if not PARAMETERS.device: print "No device provided" sys.exit(1) - + + userCheck() + user_info = getUSERID() re_code = user_info[0] if re_code == 0 : diff --git a/wearable/tct-playerutil-tizen-tests/inst.wgt.py b/wearable/tct-playerutil-tizen-tests/inst.wgt.py index 5b1718da1..c7f89fd44 100644 --- a/wearable/tct-playerutil-tizen-tests/inst.wgt.py +++ b/wearable/tct-playerutil-tizen-tests/inst.wgt.py @@ -7,7 +7,7 @@ import time import sys import subprocess import string -from optparse import OptionParser, make_option +from optparse import OptionParser, make_option import ConfigParser @@ -20,7 +20,16 @@ tct_parser = ConfigParser.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): # Do not need handle timeout in this short script, let tool do it @@ -116,7 +125,7 @@ def uninstPKGs(): 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 @@ -145,7 +154,7 @@ def instPKGs(): 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: @@ -187,7 +196,7 @@ def main(): sys.exit(1) if not PARAMETERS.user: - PARAMETERS.user = "owner" + PARAMETERS.user = EXECUTION_MODE_30 if not PARAMETERS.mode: PARAMETERS.mode = "SDB" @@ -204,7 +213,9 @@ def main(): if not PARAMETERS.device: print "No device provided" sys.exit(1) - + + userCheck() + user_info = getUSERID() re_code = user_info[0] if re_code == 0 :