[mobile][wearable][tv][ext01][Change path for supporting global user] 08/111308/1
authormengli.zhang <mengli.zhang@samsung.com>
Fri, 20 Jan 2017 18:18:51 +0000 (13:18 -0500)
committermengli.zhang <mengli.zhang@samsung.com>
Fri, 20 Jan 2017 18:20:19 +0000 (13:20 -0500)
Signed-off-by: mengli.zhang <mengli.zhang@samsung.com>
Change-Id: I70c139d9b9fd8f30ad779ae3895f035e65a5c10f

12 files changed:
mobile/tct-ext01-wrt-tests/inst.wgt.py
mobile/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js [new file with mode: 0755]
mobile/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js [new file with mode: 0755]
mobile/tct-ext01-wrt-tests/setting-install-location-auto/test_index.html
tv/tct-ext01-wrt-tests/inst.wgt.py
tv/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js [new file with mode: 0755]
tv/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js [new file with mode: 0755]
tv/tct-ext01-wrt-tests/setting-install-location-auto/test_index.html
wearable/tct-ext01-wrt-tests/inst.wgt.py
wearable/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js [new file with mode: 0755]
wearable/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js [new file with mode: 0755]
wearable/tct-ext01-wrt-tests/setting-install-location-auto/test_index.html

index 4d4943e7451a2e015fd31acc86e5f2d3bec63d06..57d4acde2914c7a3f9507313e4cc43323e4c4f48 100755 (executable)
@@ -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
@@ -111,7 +120,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
@@ -137,7 +146,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:
@@ -176,7 +185,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"
 
@@ -194,6 +203,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
diff --git a/mobile/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js b/mobile/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js
new file mode 100755 (executable)
index 0000000..bc040d5
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+
+Copyright (c) 2015 Samsung Electronics Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the License);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+
+Authors:
+        Wei Ji <wei.ji@samsung.com>
+ */
+
+var APPS_ROOT = "";
+document.write('<script src="jquery-1.10.2.min.js"></script>');
+document.write('<script src="getJsonConf.js"></script>');
\ No newline at end of file
diff --git a/mobile/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js b/mobile/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js
new file mode 100755 (executable)
index 0000000..1ee62d5
--- /dev/null
@@ -0,0 +1,59 @@
+/*\r
+Copyright (c) 2013 Intel Corporation.\r
+\r
+Redistribution and use in source and binary forms, with or without modification,\r
+are permitted provided that the following conditions are met:\r
+\r
+* Redistributions of works must retain the original copyright notice, this list\r
+  of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the original copyright notice,\r
+  this list of conditions and the following disclaimer in the documentation\r
+  and/or other materials provided with the distribution.\r
+* Neither the name of Intel Corporation nor the names of its contributors\r
+  may be used to endorse or promote products derived from this work without\r
+  specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+Authors:\r
+        Li, Hao <haox.li@intel.com>\r
+\r
+*/\r
+var USER_DIR, APP_DIR_ADMIN, APP_DIR_OTHER, USER_EX, USER_AD;\r
+$.ajax({\r
+  url:"/tmp/TCT_CONFIG",\r
+  data:{},\r
+  async:false,\r
+  success:function(data){\r
+    var regEx = /DEVICE_USER_30=(.+)/i;\r
+    var userE = /DEVICE_EXECUTION_MODE_30=(.+)/i;\r
+    var userA = /DEVICE_ADMIN_USER_30=(.+)/i;\r
+    var AppsRootAd = /DEVICE_ADMIN_USER_APPS_ROOT_30=(.+)/i;\r
+    var AppsRootOt = /DEVICE_OTHER_USER_APPS_ROOT_30=(.+)/i;\r
+    var user = regEx.exec(data);\r
+    var userEXE = userE.exec(data);\r
+    var userEXA = userA.exec(data);\r
+    var AppsRootAdmin = AppsRootAd.exec(data);\r
+    var AppsRootOther = AppsRootOt.exec(data);\r
+    USER_DIR = user[1];\r
+    USER_EX = userEXE[1];\r
+    USER_AD = userEXA[1];\r
+    APP_DIR_ADMIN = AppsRootAdmin[1];\r
+    APP_DIR_OTHER = AppsRootOther[1];\r
+  }\r
+});\r
+if(USER_EX == USER_AD){\r
+APPS_ROOT = APP_DIR_ADMIN;\r
+}\r
+else{\r
+APPS_ROOT = APP_DIR_OTHER;\r
+}
\ No newline at end of file
index c8cfb94cf52396c6662ce15393703e4f85b74cc8..d6f8e77786434e6eff82e268f395e468ce7171cd 100755 (executable)
@@ -39,6 +39,7 @@ Authors:
     <meta charset="utf-8">
     <script src="resources/testharness.js"></script>
     <script src="resources/testharnessreport.js"></script>
+    <script src="ext01_common.js"></script>
   </head>
   <body>
     <div id="log"></div>
@@ -50,7 +51,7 @@ Authors:
             assert_equals(img_path.src, excepted);
         }, "Check that when set install-location to 'auto', the install location is system defined install location.");*/
        test(function() {
-            var exceptedPath = "file:///home/owner/apps_rw/wrt2sil051/res/wgt/icon.png";
+            var exceptedPath = "file://" + APPS_ROOT + "/wrt2sil051/res/wgt/icon.png";
            function successCB(file){
                 assert_equals("icon.png", file.name);
             }
index 4d4943e7451a2e015fd31acc86e5f2d3bec63d06..57d4acde2914c7a3f9507313e4cc43323e4c4f48 100755 (executable)
@@ -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
@@ -111,7 +120,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
@@ -137,7 +146,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:
@@ -176,7 +185,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"
 
@@ -194,6 +203,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
diff --git a/tv/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js b/tv/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js
new file mode 100755 (executable)
index 0000000..bc040d5
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+
+Copyright (c) 2015 Samsung Electronics Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the License);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+
+Authors:
+        Wei Ji <wei.ji@samsung.com>
+ */
+
+var APPS_ROOT = "";
+document.write('<script src="jquery-1.10.2.min.js"></script>');
+document.write('<script src="getJsonConf.js"></script>');
\ No newline at end of file
diff --git a/tv/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js b/tv/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js
new file mode 100755 (executable)
index 0000000..1ee62d5
--- /dev/null
@@ -0,0 +1,59 @@
+/*\r
+Copyright (c) 2013 Intel Corporation.\r
+\r
+Redistribution and use in source and binary forms, with or without modification,\r
+are permitted provided that the following conditions are met:\r
+\r
+* Redistributions of works must retain the original copyright notice, this list\r
+  of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the original copyright notice,\r
+  this list of conditions and the following disclaimer in the documentation\r
+  and/or other materials provided with the distribution.\r
+* Neither the name of Intel Corporation nor the names of its contributors\r
+  may be used to endorse or promote products derived from this work without\r
+  specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+Authors:\r
+        Li, Hao <haox.li@intel.com>\r
+\r
+*/\r
+var USER_DIR, APP_DIR_ADMIN, APP_DIR_OTHER, USER_EX, USER_AD;\r
+$.ajax({\r
+  url:"/tmp/TCT_CONFIG",\r
+  data:{},\r
+  async:false,\r
+  success:function(data){\r
+    var regEx = /DEVICE_USER_30=(.+)/i;\r
+    var userE = /DEVICE_EXECUTION_MODE_30=(.+)/i;\r
+    var userA = /DEVICE_ADMIN_USER_30=(.+)/i;\r
+    var AppsRootAd = /DEVICE_ADMIN_USER_APPS_ROOT_30=(.+)/i;\r
+    var AppsRootOt = /DEVICE_OTHER_USER_APPS_ROOT_30=(.+)/i;\r
+    var user = regEx.exec(data);\r
+    var userEXE = userE.exec(data);\r
+    var userEXA = userA.exec(data);\r
+    var AppsRootAdmin = AppsRootAd.exec(data);\r
+    var AppsRootOther = AppsRootOt.exec(data);\r
+    USER_DIR = user[1];\r
+    USER_EX = userEXE[1];\r
+    USER_AD = userEXA[1];\r
+    APP_DIR_ADMIN = AppsRootAdmin[1];\r
+    APP_DIR_OTHER = AppsRootOther[1];\r
+  }\r
+});\r
+if(USER_EX == USER_AD){\r
+APPS_ROOT = APP_DIR_ADMIN;\r
+}\r
+else{\r
+APPS_ROOT = APP_DIR_OTHER;\r
+}
\ No newline at end of file
index c8cfb94cf52396c6662ce15393703e4f85b74cc8..d6f8e77786434e6eff82e268f395e468ce7171cd 100755 (executable)
@@ -39,6 +39,7 @@ Authors:
     <meta charset="utf-8">
     <script src="resources/testharness.js"></script>
     <script src="resources/testharnessreport.js"></script>
+    <script src="ext01_common.js"></script>
   </head>
   <body>
     <div id="log"></div>
@@ -50,7 +51,7 @@ Authors:
             assert_equals(img_path.src, excepted);
         }, "Check that when set install-location to 'auto', the install location is system defined install location.");*/
        test(function() {
-            var exceptedPath = "file:///home/owner/apps_rw/wrt2sil051/res/wgt/icon.png";
+            var exceptedPath = "file://" + APPS_ROOT + "/wrt2sil051/res/wgt/icon.png";
            function successCB(file){
                 assert_equals("icon.png", file.name);
             }
index 4d4943e7451a2e015fd31acc86e5f2d3bec63d06..57d4acde2914c7a3f9507313e4cc43323e4c4f48 100755 (executable)
@@ -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
@@ -111,7 +120,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
@@ -137,7 +146,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:
@@ -176,7 +185,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"
 
@@ -194,6 +203,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
diff --git a/wearable/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js b/wearable/tct-ext01-wrt-tests/setting-install-location-auto/ext01_common.js
new file mode 100755 (executable)
index 0000000..bc040d5
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+
+Copyright (c) 2015 Samsung Electronics Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the License);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+
+Authors:
+        Wei Ji <wei.ji@samsung.com>
+ */
+
+var APPS_ROOT = "";
+document.write('<script src="jquery-1.10.2.min.js"></script>');
+document.write('<script src="getJsonConf.js"></script>');
\ No newline at end of file
diff --git a/wearable/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js b/wearable/tct-ext01-wrt-tests/setting-install-location-auto/getJsonConf.js
new file mode 100755 (executable)
index 0000000..1ee62d5
--- /dev/null
@@ -0,0 +1,59 @@
+/*\r
+Copyright (c) 2013 Intel Corporation.\r
+\r
+Redistribution and use in source and binary forms, with or without modification,\r
+are permitted provided that the following conditions are met:\r
+\r
+* Redistributions of works must retain the original copyright notice, this list\r
+  of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the original copyright notice,\r
+  this list of conditions and the following disclaimer in the documentation\r
+  and/or other materials provided with the distribution.\r
+* Neither the name of Intel Corporation nor the names of its contributors\r
+  may be used to endorse or promote products derived from this work without\r
+  specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+Authors:\r
+        Li, Hao <haox.li@intel.com>\r
+\r
+*/\r
+var USER_DIR, APP_DIR_ADMIN, APP_DIR_OTHER, USER_EX, USER_AD;\r
+$.ajax({\r
+  url:"/tmp/TCT_CONFIG",\r
+  data:{},\r
+  async:false,\r
+  success:function(data){\r
+    var regEx = /DEVICE_USER_30=(.+)/i;\r
+    var userE = /DEVICE_EXECUTION_MODE_30=(.+)/i;\r
+    var userA = /DEVICE_ADMIN_USER_30=(.+)/i;\r
+    var AppsRootAd = /DEVICE_ADMIN_USER_APPS_ROOT_30=(.+)/i;\r
+    var AppsRootOt = /DEVICE_OTHER_USER_APPS_ROOT_30=(.+)/i;\r
+    var user = regEx.exec(data);\r
+    var userEXE = userE.exec(data);\r
+    var userEXA = userA.exec(data);\r
+    var AppsRootAdmin = AppsRootAd.exec(data);\r
+    var AppsRootOther = AppsRootOt.exec(data);\r
+    USER_DIR = user[1];\r
+    USER_EX = userEXE[1];\r
+    USER_AD = userEXA[1];\r
+    APP_DIR_ADMIN = AppsRootAdmin[1];\r
+    APP_DIR_OTHER = AppsRootOther[1];\r
+  }\r
+});\r
+if(USER_EX == USER_AD){\r
+APPS_ROOT = APP_DIR_ADMIN;\r
+}\r
+else{\r
+APPS_ROOT = APP_DIR_OTHER;\r
+}
\ No newline at end of file
index c8cfb94cf52396c6662ce15393703e4f85b74cc8..d6f8e77786434e6eff82e268f395e468ce7171cd 100755 (executable)
@@ -39,6 +39,7 @@ Authors:
     <meta charset="utf-8">
     <script src="resources/testharness.js"></script>
     <script src="resources/testharnessreport.js"></script>
+    <script src="ext01_common.js"></script>
   </head>
   <body>
     <div id="log"></div>
@@ -50,7 +51,7 @@ Authors:
             assert_equals(img_path.src, excepted);
         }, "Check that when set install-location to 'auto', the install location is system defined install location.");*/
        test(function() {
-            var exceptedPath = "file:///home/owner/apps_rw/wrt2sil051/res/wgt/icon.png";
+            var exceptedPath = "file://" + APPS_ROOT + "/wrt2sil051/res/wgt/icon.png";
            function successCB(file){
                 assert_equals("icon.png", file.name);
             }