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

Commit 68803217 authored by Pomai Ahlo's avatar Pomai Ahlo
Browse files

[PTS-Bot] Add L2CAP/COS Tests

Adds necessary MMIs to run the following L2CAP Tests:
L2CAP/COS/CED/BI-01-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/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

Test: atest pts-bot:L2CAP/COS
Tag: #feature
Bug: 245578454
Change-Id: I97b2e7f5dda20a8ad794c0e8ea436e67bf8b11e9
parent ac61361c
Loading
Loading
Loading
Loading
+66 −1
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@ from mmi2grpc._proxy import ProfileProxy


from pandora_experimental.host_grpc import Host
from pandora_experimental.host_grpc import Host
from pandora_experimental.host_pb2 import Connection, OwnAddressType
from pandora_experimental.host_pb2 import Connection, OwnAddressType
from pandora_experimental.security_grpc import Security
from pandora_experimental.l2cap_grpc import L2CAP
from pandora_experimental.l2cap_grpc import L2CAP


from typing import Optional
from typing import Optional
@@ -21,6 +22,10 @@ class L2CAPProxy(ProfileProxy):
        super().__init__(channel)
        super().__init__(channel)
        self.l2cap = L2CAP(channel)
        self.l2cap = L2CAP(channel)
        self.host = Host(channel)
        self.host = Host(channel)
        self.security = Security(channel)

        self.connection = None
        self.pairing_events = None


    @assert_description
    @assert_description
    def MMI_IUT_SEND_LE_CREDIT_BASED_CONNECTION_REQUEST(self, test: str, pts_addr: bytes, **kwargs):
    def MMI_IUT_SEND_LE_CREDIT_BASED_CONNECTION_REQUEST(self, test: str, pts_addr: bytes, **kwargs):
@@ -350,7 +355,7 @@ class L2CAPProxy(ProfileProxy):
        return "OK"
        return "OK"


    @assert_description
    @assert_description
    def MMI_IUT_SEND_ACL_DISCONNECTION(self, **kwargs):
    def MMI_IUT_SEND_ACL_DISCONNECTION(self, test: str, **kwargs):
        """
        """
        Initiate an ACL disconnection from the IUT to the PTS.
        Initiate an ACL disconnection from the IUT to the PTS.
        Description :
        Description :
@@ -359,3 +364,63 @@ class L2CAPProxy(ProfileProxy):
        """
        """
        self.host.Disconnect(connection=self.connection)
        self.host.Disconnect(connection=self.connection)
        return "OK"
        return "OK"

    def MMI_TESTER_ENABLE_CONNECTION(self, **kwargs):
        """
        Action: Place the IUT in connectable mode.

        Description: PTS requires that the IUT be in connectable mode.
        The PTS will attempt to establish an ACL connection.
        """

        return "OK"

    @assert_description
    def MMI_IUT_INITIATE_ACL_CONNECTION(self, pts_addr: bytes, **kwargs):
        """
        Using the Implementation Under Test(IUT), initiate ACL Create Connection
        Request to the PTS.

        Description : The Implementation Under Test(IUT)
        should create ACL connection request to PTS.
        """
        self.pairing_events = self.security.OnPairing()
        self.connection = self.host.Connect(address=pts_addr, manually_confirm=True).connection
        return "OK"

    @assert_description
    def _mmi_2001(self, **kwargs):
        """
        Please verify the passKey is correct: 000000
        """
        passkey = "000000"
        for event in self.pairing_events:
            if event.numeric_comparison == int(passkey):
                self.pairing_events.send(event=event, confirm=True)
                return "OK"
            assert False, "The passkey does not match"
        assert False, "Unexpected pairing event"

    @assert_description
    def MMI_IUT_SEND_CONFIG_REQ(self, **kwargs):
        """
        Please send Configure Request.
        """

        return "OK"

    @assert_description
    def MMI_IUT_SEND_CONFIG_RSP(self, **kwargs):
        """
        Please send Configure Response.
        """

        return "OK"

    @assert_description
    def MMI_IUT_SEND_DISCONNECT_RSP(self, **kwargs):
        """
        Please send L2CAP Disconnection Response to PTS.
        """

        return "OK"
+1 −0
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@
        <option name="profile" value="MAP" />
        <option name="profile" value="MAP" />
        <option name="profile" value="PBAP/PSE" />
        <option name="profile" value="PBAP/PSE" />
        <option name="profile" value="RFCOMM" />
        <option name="profile" value="RFCOMM" />
        <option name="profile" value="L2CAP/COS" />
        <option name="profile" value="SDP" />
        <option name="profile" value="SDP" />
        <option name="profile" value="SM" />
        <option name="profile" value="SM" />
    </test>
    </test>
+1 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@
        <option name="profile" value="GATT" />
        <option name="profile" value="GATT" />
        <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/LE" />
        <option name="profile" value="L2CAP/LE" />
        <option name="profile" value="MAP" />
        <option name="profile" value="MAP" />
        <option name="profile" value="PBAP/PSE" />
        <option name="profile" value="PBAP/PSE" />
+31 −0
Original line number Original line Diff line number Diff line
@@ -308,6 +308,16 @@
    "HOGP/RH/HGRF/BV-08-I",
    "HOGP/RH/HGRF/BV-08-I",
    "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/BV-05-C",
    "L2CAP/COS/CED/BV-07-C",
    "L2CAP/COS/CED/BV-08-C",
    "L2CAP/COS/CED/BV-11-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/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",
@@ -703,6 +713,27 @@
    "HFP/AG/OCN/BV-01-I",
    "HFP/AG/OCN/BV-01-I",
    "HFP/AG/SLC/BV-04-C",
    "HFP/AG/SLC/BV-04-C",
    "HID/HOS/HCR/BV-01-I",
    "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",
    "L2CAP/COS/CED/BV-12-C",
    "L2CAP/COS/CED/BV-13-C",
    "L2CAP/COS/CFD/BV-01-C",
    "L2CAP/COS/CFD/BV-09-C",
    "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-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",