[mobile][tct-humanactivitymonitor-tizen-tests][Testcase sync from Suprem] 62/111562/1
authorzhangwei <wei625.zhang@samsung.com>
Sun, 22 Jan 2017 16:07:28 +0000 (00:07 +0800)
committerzhangwei <wei625.zhang@samsung.com>
Sun, 22 Jan 2017 16:07:33 +0000 (00:07 +0800)
Change-Id: Ia2b8c33e332a07bd3296cc10caef82430c85156e
Signed-off-by: zhangwei <wei625.zhang@samsung.com>
mobile/tct-humanactivitymonitor-tizen-tests/askpolicy.sh [new file with mode: 0755]
mobile/tct-humanactivitymonitor-tizen-tests/inst.wgt.py
mobile/tct-humanactivitymonitor-tizen-tests/suite.json
mobile/tct-humanactivitymonitor-tizen-tests/tests.xml

diff --git a/mobile/tct-humanactivitymonitor-tizen-tests/askpolicy.sh b/mobile/tct-humanactivitymonitor-tizen-tests/askpolicy.sh
new file mode 100755 (executable)
index 0000000..1c39bdd
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+for i in `grep -r "0xA" /var/cynara/db/_ | grep $1`
+do
+    CLIENT=`echo $i | cut -d ";" -f1`
+    USER=`echo $i | cut -d ";" -f2`
+    PRIVILEGE=`echo $i | cut -d ";" -f3`
+    #echo "cyad --erase=\"\" -r=no -c $CLIENT -u $USER -p $PRIVILEGE"
+    cyad --erase="" -r=no -c $CLIENT -u $USER -p $PRIVILEGE
+done
index e744580baa470c066811a0a1ece91cb6764612e9..851f32dae29f411e16c94359ce69be37f0ea13ea 100644 (file)
@@ -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
@@ -117,7 +142,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 +171,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 +213,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 +231,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
@@ -224,6 +251,7 @@ def main():
             sys.exit(1)
     else:
         if not instPKGs():
+            #askpolicyremoving()
             sys.exit(1)
 
 if __name__ == "__main__":
index fb3d6963db263883429ba43ce2371c01b5a1107f..02e73857fed51791d07f979022040260d2180b0c 100644 (file)
@@ -46,6 +46,7 @@
             ],
             "copylist": {
                 "inst.xpk.py": "inst.py",
+                "askpolicy.sh": "askpolicy.sh",
                 "tests.full.xml": "tests.full.xml",
                 "tests.xml": "tests.xml"
             },
index 854e4e20599ce235b4c225b20fe15889585a342b..6b4d2eee4f66dc65b85b0e48c6c6bacec0aae05e 100644 (file)
           <test_script_entry>/opt/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_getHumanActivityData_stepStatus_RUNNING.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check if the specifies the pedometer user's current movement type is UNKNOWN" onload_delay="60" component="Tizen Device APIs/HumanActivityMonitor/HumanActivityMonitorManager" execution_type="manual" priority="P1" id="HumanActivityMonitorManager_getHumanActivityData_stepStatus_UNKNOWN">
-        <description>
-          <steps>
-            <step order="1">
-              <step_desc>Press run button, press Power key to keep the device LCS off, then Pretend walking with the device.</step_desc>
-              <expected>Pass</expected>
-            </step>
-          </steps>
-          <test_script_entry>/opt/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_getHumanActivityData_stepStatus_UNKNOWN.html</test_script_entry>
-        </description>
-      </testcase>
       <testcase purpose="Check if readRecorderData can be called with empty object as query argument" component="Tizen Device APIs/System/HumanActivityMonitor" execution_type="manual" onload_delay="60" id="HumanActivityMonitorManager_readRecorderData_query_empty">
         <description>
           <steps>
         </description>
       </testcase>
     </set>
+       <set name="HumanActivityMonitor" type="js">
+      <capabilities>
+        <capability name="http://tizen.org/feature/platform.core.cpu.arch.armv7"/>
+      </capabilities>
+      <testcase purpose="Check if the specifies the pedometer user's current movement type is UNKNOWN" onload_delay="60" component="Tizen Device APIs/HumanActivityMonitor/HumanActivityMonitorManager" execution_type="manual" priority="P1" id="HumanActivityMonitorManager_getHumanActivityData_stepStatus_UNKNOWN">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc>Press run button, press Power key to keep the device LCS off, then Pretend walking with the device.</step_desc>
+              <expected>Pass</expected>
+            </step>
+          </steps>
+          <test_script_entry>/opt/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_getHumanActivityData_stepStatus_UNKNOWN.html</test_script_entry>
+        </description>
+      </testcase>
+    </set> 
   </suite>
-</test_definition>
\ No newline at end of file
+</test_definition>