[mobile][tct-application-tizen-tests][change path for supporting global user] 04/111204/1
authorxy.qian <xy.qian@samsung.com>
Fri, 20 Jan 2017 02:15:47 +0000 (10:15 +0800)
committerxy.qian <xy.qian@samsung.com>
Fri, 20 Jan 2017 02:15:54 +0000 (10:15 +0800)
Change-Id: I55be1a21fa7449d992fb17fad64b38e0260d0f31
Signed-off-by: xy.qian <xy.qian@samsung.com>
mobile/tct-application-tizen-tests/inst.wgt.py
mobile/tct-application-tizen-tests/tests.full.xml
mobile/tct-application-tizen-tests/tests.xml

index cd0fc5e562877b4fdc324712a585f58b74d1c428..9e0c931c314f52699c738d27c3315abdaf7256e6 100644 (file)
@@ -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
@@ -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
@@ -151,7 +160,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:
@@ -186,7 +195,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,6 +213,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
index 9b9066f6dd6d23092e1c02ce4ed872c2a5d8f1a6..da4a8f2ae962be969b23c663d150693c963ba341 100644 (file)
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it)</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>
       </testcase>
       <testcase purpose="Check argument passed into method which is onuninstalled listener in ApplicationInformationEventCallback" type="compliance" status="approved" component="TizenAPI/Application/Application" execution_type="manual" priority="P1" id="ApplicationInformationEventCallback_onuninstalled">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
               <step_desc>Click run and uninstall TCTAppInfoEventTest1 application.</step_desc>
       </testcase>
       <testcase purpose="Check argument passed into method which is onupdated listener in ApplicationInformationEventCallback" type="compliance" status="approved" component="TizenAPI/Application/Application" execution_type="manual" priority="P1" id="ApplicationInformationEventCallback_onupdated">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it)</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>
       </testcase>
       <testcase purpose="Check using addAppInfoEventListener method (deinstallation process) in ApplicationManager interface" type="compliance" status="approved" component="TizenAPI/Application/Application" execution_type="manual" priority="P1" id="ApplicationManager_addAppInfoEventListener_onuninstalled">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
               <step_desc>Click run and uninstall TCTAppInfoEventTest1 application.</step_desc>
       </testcase>
       <testcase purpose="Check using addAppInfoEventListener method (updating process) in ApplicationManager interface" type="compliance" status="approved" component="TizenAPI/Application/Application" execution_type="manual" priority="P1" id="ApplicationManager_addAppInfoEventListener_onupdated">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>
index 5046ac245caaa29469ab78847db863c63a0ed4c2..2f565f724b6f2e32ec137ae57c669f0aa0216073 100644 (file)
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it)</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest1.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>
       </testcase>
       <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationInformationEventCallback_onuninstalled" priority="P1" purpose="Check argument passed into method which is onuninstalled listener in ApplicationInformationEventCallback">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
               <step_desc>Click run and uninstall TCTAppInfoEventTest1 application.</step_desc>
       </testcase>
       <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationInformationEventCallback_onupdated" priority="P1" purpose="Check argument passed into method which is onupdated listener in ApplicationInformationEventCallback">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest2.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest2.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it)</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest1.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>
       </testcase>
       <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationManager_addAppInfoEventListener_onuninstalled" priority="P1" purpose="Check using addAppInfoEventListener method (deinstallation process) in ApplicationManager interface">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
               <step_desc>Click run and uninstall TCTAppInfoEventTest1 application.</step_desc>
       </testcase>
       <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationManager_addAppInfoEventListener_onupdated" priority="P1" purpose="Check using addAppInfoEventListener method (updating process) in ApplicationManager interface">
         <description>
-          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
+          <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
             <step order="1">
-              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p /home/owner/share/Others/TCTAppInfoEventTest2.wgt".</step_desc>
+              <step_desc>Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest2.wgt".</step_desc>
               <expected>Pass</expected>
             </step>
           </steps>