[common][vibration][change path for supporting global user] 05/111305/3
authorwei.ji <wei.ji@samsung.com>
Fri, 20 Jan 2017 06:14:53 +0000 (14:14 +0800)
committerwei.ji <wei.ji@samsung.com>
Wed, 25 Jan 2017 10:52:53 +0000 (18:52 +0800)
- change path for supporting global user in inst.wgt.py
- add capabilities to filter tc which only supports 32 bit and 64 bit targets

Change-Id: I336da54eb9cbc0c5120f4c073735b8bacb666500
Signed-off-by: wei.ji <wei.ji@samsung.com>
common/tct-vibration-w3c-tests/inst.wgt.py
common/tct-vibration-w3c-tests/tests.full.xml
common/tct-vibration-w3c-tests/tests.xml

index 5b1718da169ebc796a16962b47a209f160af24d9..8ed577c13fa1502efd2413b1f191aae30c227262 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,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):
@@ -55,8 +64,6 @@ def getUSERID():
     return doCMD(cmd)
 
 
-
-
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -116,7 +123,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 +152,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 +194,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 +211,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 :
index 267667efbc0444571b09d2564c1df6b54c428e57..cac0cf6cba0bc55bcdd3ed2464289430c2d88747 100755 (executable)
@@ -2,19 +2,27 @@
 <?xml-stylesheet type="text/xsl" href="./testcase.xsl"?>
 <test_definition>
   <suite name="tct-vibration-w3c-tests" category="W3C/HTML5 APIs">
-    <set name="Vibration" type="js">
-      <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="auto" id="api-is-present" priority="P1" purpose="Check that the vibrate() method is present" status="approved" type="compliance">
+    <set name="Vibration_32bit_target" type="js">
+      <capabilities>
+        <capability name="http://tizen.org/feature/platform.core.cpu.arch.armv7"/>
+      </capabilities>
+      <testcase purpose="Check that the vibrate() method works correctly" type="compliance" status="approved" component="W3C_HTML5 APIs/Device/Vibration API" execution_type="maunal" priority="P1" id="vibrate_basic">
         <description>
-          <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/api-is-present.html</test_script_entry>
+          <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/vibrate_basic.html</test_script_entry>
         </description>
         <specs>
           <spec>
-            <spec_assertion category="Tizen W3C API Specifications" element_name="vibrate" element_type="method" interface="Vibration" section="Device" specification="Vibration API"/>
+            <spec_assertion element_type="method" element_name="vibrate" interface="Vibration" specification="Vibration API" section="Device" category="Tizen W3C API Specifications"/>
             <spec_url>http://www.w3.org/TR/vibration/#methods</spec_url>
             <spec_statement/>
           </spec>
         </specs>
       </testcase>
+    </set>
+    <set name="Vibration_64bit_target" type="js">
+      <capabilities>
+        <capability name="http://tizen.org/feature/platform.core.cpu.arch.aarch64"/>
+      </capabilities>
       <testcase purpose="Check that the vibrate() method works correctly" type="compliance" status="approved" component="W3C_HTML5 APIs/Device/Vibration API" execution_type="maunal" priority="P1" id="vibrate_basic">
         <description>
           <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/vibrate_basic.html</test_script_entry>
           </spec>
         </specs>
       </testcase>
+    </set>
+    <set name="Vibration" type="js">
+      <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="auto" id="api-is-present" priority="P1" purpose="Check that the vibrate() method is present" status="approved" type="compliance">
+        <description>
+          <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/api-is-present.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion category="Tizen W3C API Specifications" element_name="vibrate" element_type="method" interface="Vibration" section="Device" specification="Vibration API"/>
+            <spec_url>http://www.w3.org/TR/vibration/#methods</spec_url>
+            <spec_statement/>
+          </spec>
+        </specs>
+      </testcase>
       <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="manual" id="cancel-with-0" priority="P1" purpose="If pattern is 0, cancel the pre-existing instance of the processing vibration patterns algorithm" status="ready" type="compliance">
         <description>
           <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/cancel-with-0-manual.html</test_script_entry>
index 296a0347948a13562d788604e5924f1e7fd90a30..972daa547454d649f19b4b9fdb4806d3c765817b 100755 (executable)
@@ -2,17 +2,32 @@
 <?xml-stylesheet type="text/xsl" href="./testcase.xsl"?>
 <test_definition>
   <suite name="tct-vibration-w3c-tests" category="W3C/HTML5 APIs">
-    <set name="Vibration" type="js">
-      <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="auto" id="api-is-present" purpose="Check that the vibrate() method is present">
+    <set name="Vibration_32bit_target" type="js">
+      <capabilities>
+        <capability name="http://tizen.org/feature/platform.core.cpu.arch.armv7"/>
+      </capabilities>
+      <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="manual" id="vibrate-once" purpose="Check that the vibrate() method works correctly">
         <description>
-          <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/api-is-present.html</test_script_entry>
+          <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/vibrate_basic.html</test_script_entry>
         </description>
       </testcase>
+    </set>
+    <set name="Vibration_64bit_target" type="js">
+      <capabilities>
+        <capability name="http://tizen.org/feature/platform.core.cpu.arch.aarch64"/>
+      </capabilities>
       <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="manual" id="vibrate-once" purpose="Check that the vibrate() method works correctly">
         <description>
           <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/vibrate_basic.html</test_script_entry>
         </description>
       </testcase>
+    </set>
+    <set name="Vibration" type="js">
+      <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="auto" id="api-is-present" purpose="Check that the vibrate() method is present">
+        <description>
+          <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/api-is-present.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase component="W3C_HTML5 APIs/Device/Vibration API" execution_type="manual" id="cancel-with-0" purpose="If pattern is 0, cancel the pre-existing instance of the processing vibration patterns algorithm">
         <description>
           <test_script_entry>/opt/tct-vibration-w3c-tests/vibration/w3c/cancel-with-0-manual.html</test_script_entry>