Skip to content
Snippets Groups Projects
Commit 6160fe6d authored by Charlie Boutier's avatar Charlie Boutier Committed by Gerrit Code Review
Browse files

Merge "[PTS-Bot] Added 11 L2CAP test cases"

parents c2c895c5 9b1a6095
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ from typing import Optional ...@@ -16,6 +16,7 @@ from typing import Optional
class L2CAPProxy(ProfileProxy): class L2CAPProxy(ProfileProxy):
test_status_map = {} # record test status and pass them between MMI test_status_map = {} # record test status and pass them between MMI
LE_DATA_PACKET_LARGE = "data: LE_DATA_PACKET_LARGE" LE_DATA_PACKET_LARGE = "data: LE_DATA_PACKET_LARGE"
LE_DATA_PACKET1 = "data: LE_PACKET1"
connection: Optional[Connection] = None connection: Optional[Connection] = None
def __init__(self, channel): def __init__(self, channel):
...@@ -101,6 +102,10 @@ class L2CAPProxy(ProfileProxy): ...@@ -101,6 +102,10 @@ class L2CAPProxy(ProfileProxy):
) )
# not strictly necessary, but can save time on waiting connection # not strictly necessary, but can save time on waiting connection
tests_to_open_bluetooth_server_socket = [ tests_to_open_bluetooth_server_socket = [
"L2CAP/COS/CFC/BV-01-C",
"L2CAP/COS/CFC/BV-02-C",
"L2CAP/COS/CFC/BV-03-C",
"L2CAP/COS/CFC/BV-04-C",
"L2CAP/LE/CFC/BV-03-C", "L2CAP/LE/CFC/BV-03-C",
"L2CAP/LE/CFC/BV-05-C", "L2CAP/LE/CFC/BV-05-C",
"L2CAP/LE/CFC/BV-06-C", "L2CAP/LE/CFC/BV-06-C",
...@@ -138,7 +143,7 @@ class L2CAPProxy(ProfileProxy): ...@@ -138,7 +143,7 @@ class L2CAPProxy(ProfileProxy):
return "OK" return "OK"
@match_description @match_description
def MMI_UPPER_TESTER_CONFIRM_LE_DATA(self, sent_data: str, **kwargs): def MMI_UPPER_TESTER_CONFIRM_LE_DATA(self, sent_data: str, test: str, **kwargs):
""" """
Did the Upper Tester send the data (?P<sent_data>[0-9A-F]*) to to the Did the Upper Tester send the data (?P<sent_data>[0-9A-F]*) to to the
PTS\? Click Yes if it matched, otherwise click No. PTS\? Click Yes if it matched, otherwise click No.
...@@ -146,10 +151,13 @@ class L2CAPProxy(ProfileProxy): ...@@ -146,10 +151,13 @@ class L2CAPProxy(ProfileProxy):
Description: The Implementation Under Test Description: The Implementation Under Test
\(IUT\) send data is receive correctly in the PTS. \(IUT\) send data is receive correctly in the PTS.
""" """
hex_LE_DATA_PACKET_LARGE = self.LE_DATA_PACKET_LARGE.encode("utf-8").hex().upper() if test == 'L2CAP/COS/CFC/BV-02-C':
if sent_data != hex_LE_DATA_PACKET_LARGE: hex_LE_DATA_PACKET = self.LE_DATA_PACKET1.encode("utf-8").hex().upper()
print(f"data not match, sent_data:{sent_data} and {hex_LE_DATA_PACKET_LARGE}", file=sys.stderr) else:
raise Exception(f"data not match, sent_data:{sent_data} and {hex_LE_DATA_PACKET_LARGE}") hex_LE_DATA_PACKET = self.LE_DATA_PACKET_LARGE.encode("utf-8").hex().upper()
if sent_data != hex_LE_DATA_PACKET:
print(f"data not match, sent_data:{sent_data} and {hex_LE_DATA_PACKET}", file=sys.stderr)
raise Exception(f"data not match, sent_data:{sent_data} and {hex_LE_DATA_PACKET}")
return "OK" return "OK"
@assert_description @assert_description
...@@ -424,3 +432,23 @@ class L2CAPProxy(ProfileProxy): ...@@ -424,3 +432,23 @@ class L2CAPProxy(ProfileProxy):
""" """
return "OK" return "OK"
@assert_description
def MMI_UPPER_TESTER_SEND_LE_DATA_PACKET1(self, **kwargs):
"""
Upper Tester command IUT to send a non-segmented LE data packet to the
PTS with any values.
Description : The Implementation Under Test(IUT)
should send none segmantation LE frame of LE data to the PTS.
"""
self.l2cap.SendData(connection=self.connection, data=bytes(self.LE_DATA_PACKET1, "utf-8"))
return "OK"
@assert_description
def MMI_IUT_SEND_L2CAP_DATA(self, **kwargs):
"""
Using the Implementation Under Test(IUT), send L2CAP_Data over the
assigned channel with correct DCID to the PTS.
"""
return "OK"
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<option name="profile" value="HID/HOS" /> <option name="profile" value="HID/HOS" />
<option name="profile" value="HOGP" /> <option name="profile" value="HOGP" />
<option name="profile" value="L2CAP/COS" /> <option name="profile" value="L2CAP/COS" />
<option name="profile" value="L2CAP/EXF" />
<option name="profile" value="L2CAP/LE" /> <option name="profile" value="L2CAP/LE" />
<option name="profile" value="MAP" /> <option name="profile" value="MAP" />
<option name="profile" value="OPP" /> <option name="profile" value="OPP" />
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<option name="profile" value="HID/HOS" /> <option name="profile" value="HID/HOS" />
<option name="profile" value="HOGP" /> <option name="profile" value="HOGP" />
<option name="profile" value="L2CAP/COS" /> <option name="profile" value="L2CAP/COS" />
<option name="profile" value="L2CAP/EXF" />
<option name="profile" value="L2CAP/LE" /> <option name="profile" value="L2CAP/LE" />
<option name="profile" value="MAP" /> <option name="profile" value="MAP" />
<option name="profile" value="OPP" /> <option name="profile" value="OPP" />
......
...@@ -316,15 +316,26 @@ ...@@ -316,15 +316,26 @@
"HOGP/RH/HGRF/BV-10-I", "HOGP/RH/HGRF/BV-10-I",
"HOGP/RH/HGRF/BV-12-I", "HOGP/RH/HGRF/BV-12-I",
"L2CAP/COS/CED/BI-01-C", "L2CAP/COS/CED/BI-01-C",
"L2CAP/COS/CED/BV-03-C",
"L2CAP/COS/CED/BV-05-C", "L2CAP/COS/CED/BV-05-C",
"L2CAP/COS/CED/BV-07-C", "L2CAP/COS/CED/BV-07-C",
"L2CAP/COS/CED/BV-08-C", "L2CAP/COS/CED/BV-08-C",
"L2CAP/COS/CED/BV-11-C", "L2CAP/COS/CED/BV-11-C",
"L2CAP/COS/CFC/BV-01-C",
"L2CAP/COS/CFC/BV-02-C",
"L2CAP/COS/CFC/BV-03-C",
"L2CAP/COS/CFC/BV-04-C",
"L2CAP/COS/CFD/BV-02-C", "L2CAP/COS/CFD/BV-02-C",
"L2CAP/COS/CFD/BV-03-C", "L2CAP/COS/CFD/BV-03-C",
"L2CAP/COS/CFD/BV-11-C", "L2CAP/COS/CFD/BV-11-C",
"L2CAP/COS/CFD/BV-12-C", "L2CAP/COS/CFD/BV-12-C",
"L2CAP/COS/CFD/BV-14-C", "L2CAP/COS/CFD/BV-14-C",
"L2CAP/COS/ECH/BV-01-C",
"L2CAP/COS/IEX/BV-02-C",
"L2CAP/EXF/BV-01-C",
"L2CAP/EXF/BV-02-C",
"L2CAP/EXF/BV-03-C",
"L2CAP/EXF/BV-05-C",
"L2CAP/LE/CFC/BI-01-C", "L2CAP/LE/CFC/BI-01-C",
"L2CAP/LE/CFC/BV-01-C", "L2CAP/LE/CFC/BV-01-C",
"L2CAP/LE/CFC/BV-02-C", "L2CAP/LE/CFC/BV-02-C",
...@@ -755,7 +766,6 @@ ...@@ -755,7 +766,6 @@
"HID/HOS/HCR/BV-01-I", "HID/HOS/HCR/BV-01-I",
"L2CAP/COS/CED/BI-02-C", "L2CAP/COS/CED/BI-02-C",
"L2CAP/COS/CED/BV-01-C", "L2CAP/COS/CED/BV-01-C",
"L2CAP/COS/CED/BV-03-C",
"L2CAP/COS/CED/BV-04-C", "L2CAP/COS/CED/BV-04-C",
"L2CAP/COS/CED/BV-09-C", "L2CAP/COS/CED/BV-09-C",
"L2CAP/COS/CED/BV-10-C", "L2CAP/COS/CED/BV-10-C",
...@@ -766,14 +776,9 @@ ...@@ -766,14 +776,9 @@
"L2CAP/COS/CFD/BV-08-C", "L2CAP/COS/CFD/BV-08-C",
"L2CAP/COS/CFD/BV-10-C", "L2CAP/COS/CFD/BV-10-C",
"L2CAP/COS/CFD/BV-13-C", "L2CAP/COS/CFD/BV-13-C",
"L2CAP/COS/CFC/BV-01-C",
"L2CAP/COS/CFC/BV-02-C",
"L2CAP/COS/CFC/BV-03-C",
"L2CAP/COS/CFC/BV-04-C",
"L2CAP/COS/CFC/BV-05-C", "L2CAP/COS/CFC/BV-05-C",
"L2CAP/COS/ECH/BV-02-C", "L2CAP/COS/ECH/BV-02-C",
"L2CAP/COS/IEX/BV-01-C", "L2CAP/COS/IEX/BV-01-C",
"L2CAP/COS/IEX/BV-02-C",
"L2CAP/LE/CFC/BV-07-C", "L2CAP/LE/CFC/BV-07-C",
"L2CAP/LE/CFC/BV-11-C", "L2CAP/LE/CFC/BV-11-C",
"L2CAP/LE/CFC/BV-13-C", "L2CAP/LE/CFC/BV-13-C",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment