[mobile,tv,wearable][tct-capability-tests][change path for supporting global user] 24/111524/1
authorwxch <xiaochn.wang@samsung.com>
Sat, 21 Jan 2017 08:04:47 +0000 (16:04 +0800)
committerwxch <xiaochn.wang@samsung.com>
Sat, 21 Jan 2017 08:06:10 +0000 (16:06 +0800)
Change-Id: Id0e4a2642833613a48bd4fe69158ac5049b14fa2
Signed-off-by: wxch <xiaochn.wang@samsung.com>
mobile/tct-capability-tests/inst.wgt.py
mobile/tct-capability-tests/suite.json
tv/tct-capability-tests/inst.wgt.py
tv/tct-capability-tests/suite.json
tv/tct-capability-tests/tests.xml
wearable/tct-capability-tests/inst.wgt.py
wearable/tct-capability-tests/suite.json

index 5b1718da169ebc796a16962b47a209f160af24d9..ef38eb600f18f1c170e0054cddaf87319822cc58 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,8 +20,33 @@ 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 askpolicyremoving():
+    for root, dirs, files in os.walk(SCRIPT_DIR):
+        for file in files:
+            if file.endswith(".wgt"):
+                pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
+   
+    print pkg_id
+    print (os.getcwd())
+    print (os.path.dirname(os.path.realpath(__file__)) )
+    if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
+        action_status = False
+    if PARAMETERS.mode == "SDB":
+        cmd = "sdb -s %s shell .%s/askpolicy.sh %s" % (PARAMETERS.device, 
+        SRC_DIR, pkg_id)
+    return doCMD(cmd)
+       
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
     print "-->> \"%s\"" % cmd
@@ -55,8 +80,6 @@ def getUSERID():
     return doCMD(cmd)
 
 
-
-
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -116,7 +139,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 +168,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 +210,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"
 
@@ -205,6 +228,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
@@ -223,6 +248,7 @@ def main():
             sys.exit(1)
     else:
         if not instPKGs():
+            #askpolicyremoving()
             sys.exit(1)
 
 if __name__ == "__main__":
index e40027d9f585afce576dd1a478207a1059a133d0..f1a3b28cf57449d0f3dddbb869862d0951fb0ac5 100755 (executable)
@@ -20,8 +20,8 @@
                 "tests.full.xml": "tests.full.xml",
                 "tests.xml": "tests.xml"
             },
-            "pkg-app": {\r
-                "sign-flag": "true"\r
+            "pkg-app": {
+                "sign-flag": "true"
             }
         },
         "apk-aio, cordova-aio": {
@@ -33,6 +33,7 @@
             ],
             "copylist": {
                 "inst.wgt.py": "inst.py",
+                "askpolicy.sh": "askpolicy.sh",
                 "tests.full.xml": "tests.full.xml",
                 "tests.xml": "tests.xml"
             },
index 5b1718da169ebc796a16962b47a209f160af24d9..ef38eb600f18f1c170e0054cddaf87319822cc58 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,8 +20,33 @@ 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 askpolicyremoving():
+    for root, dirs, files in os.walk(SCRIPT_DIR):
+        for file in files:
+            if file.endswith(".wgt"):
+                pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
+   
+    print pkg_id
+    print (os.getcwd())
+    print (os.path.dirname(os.path.realpath(__file__)) )
+    if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
+        action_status = False
+    if PARAMETERS.mode == "SDB":
+        cmd = "sdb -s %s shell .%s/askpolicy.sh %s" % (PARAMETERS.device, 
+        SRC_DIR, pkg_id)
+    return doCMD(cmd)
+       
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
     print "-->> \"%s\"" % cmd
@@ -55,8 +80,6 @@ def getUSERID():
     return doCMD(cmd)
 
 
-
-
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -116,7 +139,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 +168,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 +210,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"
 
@@ -205,6 +228,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
@@ -223,6 +248,7 @@ def main():
             sys.exit(1)
     else:
         if not instPKGs():
+            #askpolicyremoving()
             sys.exit(1)
 
 if __name__ == "__main__":
index e40027d9f585afce576dd1a478207a1059a133d0..f1a3b28cf57449d0f3dddbb869862d0951fb0ac5 100755 (executable)
@@ -20,8 +20,8 @@
                 "tests.full.xml": "tests.full.xml",
                 "tests.xml": "tests.xml"
             },
-            "pkg-app": {\r
-                "sign-flag": "true"\r
+            "pkg-app": {
+                "sign-flag": "true"
             }
         },
         "apk-aio, cordova-aio": {
@@ -33,6 +33,7 @@
             ],
             "copylist": {
                 "inst.wgt.py": "inst.py",
+                "askpolicy.sh": "askpolicy.sh",
                 "tests.full.xml": "tests.full.xml",
                 "tests.xml": "tests.xml"
             },
index 88e4844b37b2de65b094a00ebdd43ee98e1fe090..3f88b995500449a9d02587b500b75f2cbb738477 100755 (executable)
     </set>
     <set name="capability_multi_point_touch">
       <capabilities>
-        <capability name="http://tizen.org/feature/multi_point_touch.point_count"/>
+        <capability name="http://tizen.org/feature/multi_point_touch.point_count"><value>2</value></capability>
       </capabilities>
       <testcase component="Tizen Device APIs/System/SystemInfo" execution_type="auto" id="caps_multiTouchCount" priority="P1" purpose="Check if multiTouchCount is supported on the device.">
         <description>
index 5b1718da169ebc796a16962b47a209f160af24d9..ef38eb600f18f1c170e0054cddaf87319822cc58 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,8 +20,33 @@ 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 askpolicyremoving():
+    for root, dirs, files in os.walk(SCRIPT_DIR):
+        for file in files:
+            if file.endswith(".wgt"):
+                pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
+   
+    print pkg_id
+    print (os.getcwd())
+    print (os.path.dirname(os.path.realpath(__file__)) )
+    if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
+        action_status = False
+    if PARAMETERS.mode == "SDB":
+        cmd = "sdb -s %s shell .%s/askpolicy.sh %s" % (PARAMETERS.device, 
+        SRC_DIR, pkg_id)
+    return doCMD(cmd)
+       
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
     print "-->> \"%s\"" % cmd
@@ -55,8 +80,6 @@ def getUSERID():
     return doCMD(cmd)
 
 
-
-
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -116,7 +139,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 +168,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 +210,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"
 
@@ -205,6 +228,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
@@ -223,6 +248,7 @@ def main():
             sys.exit(1)
     else:
         if not instPKGs():
+            #askpolicyremoving()
             sys.exit(1)
 
 if __name__ == "__main__":
index e40027d9f585afce576dd1a478207a1059a133d0..f1a3b28cf57449d0f3dddbb869862d0951fb0ac5 100755 (executable)
@@ -20,8 +20,8 @@
                 "tests.full.xml": "tests.full.xml",
                 "tests.xml": "tests.xml"
             },
-            "pkg-app": {\r
-                "sign-flag": "true"\r
+            "pkg-app": {
+                "sign-flag": "true"
             }
         },
         "apk-aio, cordova-aio": {
@@ -33,6 +33,7 @@
             ],
             "copylist": {
                 "inst.wgt.py": "inst.py",
+                "askpolicy.sh": "askpolicy.sh",
                 "tests.full.xml": "tests.full.xml",
                 "tests.xml": "tests.xml"
             },