Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f32cddf authored by skarnataki's avatar skarnataki Committed by David Duarte
Browse files

[PTS-Bot] Added 11 L2CAP test cases

L2CAP/COS/CED/BV-03-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/IEX/BV-02-C
L2CAP/COS/ECH/BV-01-C
L2CAP/EXF/BV-01-C
L2CAP/EXF/BV-02-C
L2CAP/EXF/BV-03-C
L2CAP/EXF/BV-05-C

Test: atest pts-bot:L2CAP -v
Bug: 245578454
Change-Id: Id3c63f97d137d8525ec8c9f44a389b0cf2c6cc7b
(cherry picked from commit 9b1a6095)
Merged-In: Id3c63f97d137d8525ec8c9f44a389b0cf2c6cc7b
parent da44b75e
Loading
Loading
Loading
Loading
+33 −5
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ from typing import Optional
class L2CAPProxy(ProfileProxy):
    test_status_map = {}  # record test status and pass them between MMI
    LE_DATA_PACKET_LARGE = "data: LE_DATA_PACKET_LARGE"
    LE_DATA_PACKET1 = "data: LE_PACKET1"
    connection: Optional[Connection] = None

    def __init__(self, channel):
@@ -101,6 +102,10 @@ class L2CAPProxy(ProfileProxy):
        )
        # not strictly necessary, but can save time on waiting connection
        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-05-C",
            "L2CAP/LE/CFC/BV-06-C",
@@ -138,7 +143,7 @@ class L2CAPProxy(ProfileProxy):
        return "OK"

    @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
        PTS\? Click Yes if it matched, otherwise click No.
@@ -146,10 +151,13 @@ class L2CAPProxy(ProfileProxy):
        Description: The Implementation Under Test
        \(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 sent_data != hex_LE_DATA_PACKET_LARGE:
            print(f"data not match, sent_data:{sent_data} and {hex_LE_DATA_PACKET_LARGE}", file=sys.stderr)
            raise Exception(f"data not match, sent_data:{sent_data} and {hex_LE_DATA_PACKET_LARGE}")
        if test == 'L2CAP/COS/CFC/BV-02-C':
            hex_LE_DATA_PACKET = self.LE_DATA_PACKET1.encode("utf-8").hex().upper()
        else:
            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"

    @assert_description
@@ -424,3 +432,23 @@ class L2CAPProxy(ProfileProxy):
        """

        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"
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
        <option name="profile" value="HID/HOS" />
        <option name="profile" value="HOGP" />
        <option name="profile" value="L2CAP/COS" />
        <option name="profile" value="L2CAP/EXF" />
        <option name="profile" value="L2CAP/LE" />
        <option name="profile" value="MAP" />
        <option name="profile" value="OPP" />
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
        <option name="profile" value="HID/HOS" />
        <option name="profile" value="HOGP" />
        <option name="profile" value="L2CAP/COS" />
        <option name="profile" value="L2CAP/EXF" />
        <option name="profile" value="L2CAP/LE" />
        <option name="profile" value="MAP" />
        <option name="profile" value="OPP" />
+11 −6
Original line number Diff line number Diff line
@@ -316,15 +316,26 @@
    "HOGP/RH/HGRF/BV-10-I",
    "HOGP/RH/HGRF/BV-12-I",
    "L2CAP/COS/CED/BI-01-C",
    "L2CAP/COS/CED/BV-03-C",
    "L2CAP/COS/CED/BV-05-C",
    "L2CAP/COS/CED/BV-07-C",
    "L2CAP/COS/CED/BV-08-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-03-C",
    "L2CAP/COS/CFD/BV-11-C",
    "L2CAP/COS/CFD/BV-12-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/BV-01-C",
    "L2CAP/LE/CFC/BV-02-C",
@@ -755,7 +766,6 @@
    "HID/HOS/HCR/BV-01-I",
    "L2CAP/COS/CED/BI-02-C",
    "L2CAP/COS/CED/BV-01-C",
    "L2CAP/COS/CED/BV-03-C",
    "L2CAP/COS/CED/BV-04-C",
    "L2CAP/COS/CED/BV-09-C",
    "L2CAP/COS/CED/BV-10-C",
@@ -766,14 +776,9 @@
    "L2CAP/COS/CFD/BV-08-C",
    "L2CAP/COS/CFD/BV-10-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/ECH/BV-02-C",
    "L2CAP/COS/IEX/BV-01-C",
    "L2CAP/COS/IEX/BV-02-C",
    "L2CAP/LE/CFC/BV-07-C",
    "L2CAP/LE/CFC/BV-11-C",
    "L2CAP/LE/CFC/BV-13-C",