From: zhangwei Date: Sun, 22 Jan 2017 15:54:10 +0000 (+0800) Subject: [wearable][tct-sound-tizen-tests][Testcase sync from Suprem] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=817cd5ee98555b42d6bc5a98232fd02e24c5d63e;p=test%2Ftct%2Fweb%2Fapi.git [wearable][tct-sound-tizen-tests][Testcase sync from Suprem] Change-Id: I44456c893de2b7ce9cb1fe1cda1ff2081c092cae Signed-off-by: zhangwei --- diff --git a/wearable/tct-sound-tizen-tests/inst.wgt.py b/wearable/tct-sound-tizen-tests/inst.wgt.py index e744580ba..18690763e 100644 --- a/wearable/tct-sound-tizen-tests/inst.wgt.py +++ b/wearable/tct-sound-tizen-tests/inst.wgt.py @@ -20,6 +20,15 @@ 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): @@ -117,7 +126,7 @@ def uninstPKGs(): action_status = False continue (return_code, output) = doRemoteCMD( - "pkgcmd -u -t wgt -q -n %s" % pkg_id) + "pkgcmd %s -u -t wgt -q -n %s" % (GLOVAL_OPT, pkg_id)) for line in output: if "Failure" in line: action_status = False @@ -146,7 +155,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: @@ -188,7 +197,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" @@ -206,6 +215,8 @@ def main(): print "No device provided" sys.exit(1) + userCheck() + user_info = getUSERID() re_code = user_info[0] if re_code == 0 :