[mobile,wearable][tct-bluetooth-tizen-tests][change path for supporting global user] 22/111522/1
authorwxch <xiaochn.wang@samsung.com>
Sat, 21 Jan 2017 07:53:38 +0000 (15:53 +0800)
committerwxch <xiaochn.wang@samsung.com>
Sat, 21 Jan 2017 07:55:32 +0000 (15:55 +0800)
Change-Id: I4e0f16525b919db18396bd6d27d5ce83f44b366a
Signed-off-by: wxch <xiaochn.wang@samsung.com>
mobile/tct-bluetooth-tizen-tests/inst.wgt.py
mobile/tct-bluetooth-tizen-tests/tests.full.xml
mobile/tct-bluetooth-tizen-tests/tests.xml
wearable/tct-bluetooth-tizen-tests/inst.wgt.py
wearable/tct-bluetooth-tizen-tests/tests.full.xml
wearable/tct-bluetooth-tizen-tests/tests.xml

index 9f907576afa813735c9def46cbb87ceafc19545c..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100644 (file)
@@ -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):
@@ -41,7 +50,6 @@ def doCMD(cmd):
 
     return (cmd_return_code, output)
 
-
 def updateCMD(cmd=None):
     if "pkgcmd" in cmd:
         cmd = "su - %s -c '%s;%s'" % (PARAMETERS.user, XW_ENV, cmd)
@@ -56,8 +64,6 @@ def getUSERID():
     return doCMD(cmd)
 
 
-
-
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -107,6 +113,9 @@ def doRemoteCopy(src=None, dest=None):
 def uninstPKGs():
     action_status = True
     for root, dirs, files in os.walk(SCRIPT_DIR):
+        if root.endswith("mediasrc"):
+            continue
+
         for file in files:
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
@@ -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
@@ -135,18 +144,32 @@ def instPKGs():
     if return_code != 0:
         action_status = False
     for root, dirs, files in os.walk(SCRIPT_DIR):
+        if root.endswith("mediasrc"):
+            continue
+
         for file in files:
             if file.endswith(".wgt"):
                 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:
                         action_status = False
                         break
 
+    # Do some special copy/delete... steps
+    '''
+    (return_code, output) = doRemoteCMD(
+        "mkdir -p %s/tests" % PKG_SRC_DIR)
+    if return_code != 0:
+        action_status = False
+
+    if not doRemoteCopy("specname/tests", "%s/tests" % PKG_SRC_DIR):
+        action_status = False
+    '''
+
     return action_status
 
 
@@ -171,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"
 
@@ -189,6 +212,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
index f90f717a34075b95aa756a8b352dc3ad37b273e5..06167b707f8dd34b0abbb8198429f16c9c7ad60e 100644 (file)
         </specs>
       </testcase>
 </set>
+    <set name="Bluetooth_04_BLE" type="js">
+      <capabilities>
+        <capability name="http://tizen.org/feature/network.bluetooth"/>
+      </capabilities>
+      <testcase purpose="Check rssi attribute in BluetoothLEDevice" type="compliance" status="approved" component="Tizen Device APIs/Communication/Bluetooth" execution_type="manual" priority="P1" id="BluetoothLEDevice_rssi_attribute">
+        <description>
+          <pre_condition>The bluetooth of the remote/test device MUST support BLE and be turned on and discoverable from other devices.</pre_condition>
+          <test_script_entry>/opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothLEDevice_rssi_attribute.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="BluetoothLEDevice" element_type="attribute" element_name="rssi" specification="Bluetooth" section="Communication" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+    </set>
   </suite>
 </test_definition>
index bc0857d4298192c9d0beb5a07c68dab821b40f6b..0126f3b5bec96615234e914f67e0b360ac7cfbed 100644 (file)
@@ -2597,6 +2597,12 @@ The bluetooth of the remote/test device MUST be turned on and discoverable from
           <test_script_entry>/opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothLEDevice_uuids_attribute.html</test_script_entry>
         </description>
       </testcase>
+      <testcase component="Tizen Device APIs/Communication/Bluetooth" execution_type="manual" id="BluetoothLEDevice_rssi_attribute" priority="P1" purpose="Check rssi attribute in BluetoothLEDevice">
+        <description>
+          <pre_condition>The bluetooth of the remote/test device MUST support BLE and be turned on and discoverable from other devices.</pre_condition>
+          <test_script_entry>/opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothLEDevice_rssi_attribute.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase purpose="Check if BluetoothLEManufacturerData::data attribute exists, has type string and can be modified" component="TizenAPI/Communication/Bluetooth" execution_type="manual" id="BluetoothLEManufacturerData_data_attribute">
         <description>
           <pre_condition>The bluetooth of the remote/test device MUST support BLE and be turned on and discoverable from other devices.</pre_condition>
index 9f907576afa813735c9def46cbb87ceafc19545c..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100644 (file)
@@ -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):
@@ -41,7 +50,6 @@ def doCMD(cmd):
 
     return (cmd_return_code, output)
 
-
 def updateCMD(cmd=None):
     if "pkgcmd" in cmd:
         cmd = "su - %s -c '%s;%s'" % (PARAMETERS.user, XW_ENV, cmd)
@@ -56,8 +64,6 @@ def getUSERID():
     return doCMD(cmd)
 
 
-
-
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -107,6 +113,9 @@ def doRemoteCopy(src=None, dest=None):
 def uninstPKGs():
     action_status = True
     for root, dirs, files in os.walk(SCRIPT_DIR):
+        if root.endswith("mediasrc"):
+            continue
+
         for file in files:
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
@@ -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
@@ -135,18 +144,32 @@ def instPKGs():
     if return_code != 0:
         action_status = False
     for root, dirs, files in os.walk(SCRIPT_DIR):
+        if root.endswith("mediasrc"):
+            continue
+
         for file in files:
             if file.endswith(".wgt"):
                 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:
                         action_status = False
                         break
 
+    # Do some special copy/delete... steps
+    '''
+    (return_code, output) = doRemoteCMD(
+        "mkdir -p %s/tests" % PKG_SRC_DIR)
+    if return_code != 0:
+        action_status = False
+
+    if not doRemoteCopy("specname/tests", "%s/tests" % PKG_SRC_DIR):
+        action_status = False
+    '''
+
     return action_status
 
 
@@ -171,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"
 
@@ -189,6 +212,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
index f90f717a34075b95aa756a8b352dc3ad37b273e5..06167b707f8dd34b0abbb8198429f16c9c7ad60e 100644 (file)
         </specs>
       </testcase>
 </set>
+    <set name="Bluetooth_04_BLE" type="js">
+      <capabilities>
+        <capability name="http://tizen.org/feature/network.bluetooth"/>
+      </capabilities>
+      <testcase purpose="Check rssi attribute in BluetoothLEDevice" type="compliance" status="approved" component="Tizen Device APIs/Communication/Bluetooth" execution_type="manual" priority="P1" id="BluetoothLEDevice_rssi_attribute">
+        <description>
+          <pre_condition>The bluetooth of the remote/test device MUST support BLE and be turned on and discoverable from other devices.</pre_condition>
+          <test_script_entry>/opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothLEDevice_rssi_attribute.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="BluetoothLEDevice" element_type="attribute" element_name="rssi" specification="Bluetooth" section="Communication" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+    </set>
   </suite>
 </test_definition>
index bca13f961ff78e409d7d8bbd2355be1cf2f77ac0..1144dcc220b23dc1684444800d405e85426ee7b8 100644 (file)
@@ -2585,6 +2585,12 @@ The bluetooth of the remote/test device MUST be turned on and discoverable from
           <test_script_entry>/opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothLEDevice_uuids_attribute.html</test_script_entry>
         </description>
       </testcase>
+      <testcase component="Tizen Device APIs/Communication/Bluetooth" execution_type="manual" id="BluetoothLEDevice_rssi_attribute" priority="P1" purpose="Check rssi attribute in BluetoothLEDevice">
+        <description>
+          <pre_condition>The bluetooth of the remote/test device MUST support BLE and be turned on and discoverable from other devices.</pre_condition>
+          <test_script_entry>/opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothLEDevice_rssi_attribute.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase purpose="Check if BluetoothLEManufacturerData::data attribute exists, has type string and can be modified" component="TizenAPI/Communication/Bluetooth" execution_type="manual" id="BluetoothLEManufacturerData_data_attribute">
         <description>
           <pre_condition>The bluetooth of the remote/test device MUST support BLE and be turned on and discoverable from other devices.</pre_condition>