[common][sandbox][change path for supporting global user and privilege] 17/111417/1
authorw.gu <w.gu@samsung.com>
Fri, 20 Jan 2017 08:38:15 +0000 (16:38 +0800)
committerw.gu <w.gu@samsung.com>
Fri, 20 Jan 2017 08:38:23 +0000 (16:38 +0800)
Change-Id: I0ba7cbbb06daae4ec94db44fb290ee4500bd622f
Signed-off-by: w.gu <w.gu@samsung.com>
common/tct-sandbox-html5-tests/config.xml
common/tct-sandbox-html5-tests/inst.wgt.py

index f89972a4731c97a20e83d7924071957e314bcf43..059e01682cae7db4c62139ac8f40987270010313 100755 (executable)
@@ -2,6 +2,7 @@
   <access origin="*"/>
   <icon src="icon.png" height="117" width="117"/>
   <name>tct-sandbox-html5-tests</name>
+  <tizen:privilege name="http://tizen.org/privilege/internet"/>
   <tizen:application id="html5sandb.WebAPIHTML5SandboxTests" package="html5sandb" required_version="3.0"/>
   <tizen:setting screen-orientation="landscape"/>
 </widget>
index e735a701d191af9d46c1bc359534ec457240587f..9c17c1ad72abe8efd6676db89600e7198bd680af 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option\r
+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
@@ -113,7 +122,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
@@ -139,7 +148,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:
@@ -181,7 +190,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"
 
@@ -198,7 +207,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 :