[common][stab-wrt][change path for supporting global user] 36/111436/1
authorw.gu <w.gu@samsung.com>
Fri, 20 Jan 2017 09:16:48 +0000 (17:16 +0800)
committerw.gu <w.gu@samsung.com>
Fri, 20 Jan 2017 09:16:57 +0000 (17:16 +0800)
Change-Id: If28c08960d4c26e3a9ccce734c9fa7625afda324
Signed-off-by: w.gu <w.gu@samsung.com>
common/tct-stab-wrt-tests/inst.wgt.py
common/tct-stab-wrt-tests/tests.full.xml
common/tct-stab-wrt-tests/tests.xml

index 7cdee07aa893194dbba83a48a6701bcf7be77b16..8781fd7009b16746fd2620436b94bbbdba759a5d 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
@@ -114,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
@@ -143,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:
@@ -191,7 +200,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"
 
@@ -208,7 +217,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 685aedfb7b83772e4e12d25f352619160131657c..a6e66c5a1009ccc7219ab73d15038f9132cdcfa0 100755 (executable)
@@ -13,7 +13,7 @@
             <expected>Widget application is able to be installed and uninstalled successfully.</expected>
           </step>
         </steps>
-        <test_script_entry test_script_expected_result="0">owner_user@/home/owner/share/tct/opt/tct-stab-wrt-tests/scripts/wrt_pm_WRTInstaller.sh setting-bs-enable.wgt</test_script_entry>
+        <test_script_entry test_script_expected_result="0">{DEVICE_EXECUTION_MODE_30}_user@{DEVICE_SUITE_TARGET_30}/tct/opt/tct-stab-wrt-tests/scripts/wrt_pm_WRTInstaller.sh setting-bs-enable.wgt</test_script_entry>
         <notes />
       </description>
       <specs>
index a9abb11a78da7e5548cafbd771e2e462a746cc69..59e77680f3575ecbe946c010f734cc03e699e51b 100755 (executable)
@@ -5,7 +5,7 @@
     <set name="StabilityTest" type="script">
       <testcase component="Tizen WRT Core Spec/StabilityTest" execution_type="auto" id="wrt-repeat-install-uninstall" priority="P3" purpose="Check that WRT can install and uninstall webapp roundly.">
         <description>
-          <test_script_entry test_script_expected_result="0">owner_user@/home/owner/share/tct/opt/tct-stab-wrt-tests/scripts/wrt_pm_WRTInstaller.sh setting-bs-enable.wgt</test_script_entry>
+          <test_script_entry test_script_expected_result="0">{DEVICE_EXECUTION_MODE_30}_user@{DEVICE_SUITE_TARGET_30}/tct/opt/tct-stab-wrt-tests/scripts/wrt_pm_WRTInstaller.sh setting-bs-enable.wgt</test_script_entry>
         </description>
       </testcase>
     </set>