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

Commit 49ca082f authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

L2capTest: Add L2CAP/COS/CFD/BV-08-C am: 7246fe04

Change-Id: Iaa2c02f1ccd5795d5f576c35ca9bd81d3c8ec48a
parents a693b42f 7246fe04
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -190,6 +190,10 @@ class CertL2cap(Closable):
        self.control_table[CommandCode.CONFIGURATION_REQUEST] = lambda _: True
        self.control_table[CommandCode.CONNECTION_RESPONSE] = lambda _: True

    # more of a hack for the moment
    def ignore_config_request(self):
        self.control_table[CommandCode.CONFIGURATION_REQUEST] = lambda _: True

    # more of a hack for the moment
    def reply_with_unacceptable_parameters(self):
        self.control_table[
@@ -416,8 +420,8 @@ class CertL2cap(Closable):
            return
        if information_type == l2cap_packets.InformationRequestInfoType.EXTENDED_FEATURES_SUPPORTED:
            response = l2cap_packets.InformationResponseExtendedFeaturesBuilder(
                sid, l2cap_packets.InformationRequestResult.SUCCESS, 0, 0, 0, self.support_ertm,
                0, self.support_fcs, 0, 0, 0, 0)
                sid, l2cap_packets.InformationRequestResult.SUCCESS, 0, 0, 0,
                self.support_ertm, 0, self.support_fcs, 0, 0, 0, 0)
            self.control_channel.send(response)
            return
        if information_type == l2cap_packets.InformationRequestInfoType.FIXED_CHANNELS_SUPPORTED:
+14 −0
Original line number Diff line number Diff line
@@ -207,6 +207,20 @@ class L2capTest(GdBaseTestClass):
            L2capMatchers.ConfigurationRequest(),
            L2capMatchers.ConfigurationRequest()).inAnyOrder()

    def test_non_blocking_config_response(self):
        """
        L2CAP/COS/CFD/BV-08-C
        """
        self._setup_link_from_cert()

        self.cert_l2cap.ignore_config_request()

        self._open_unvalidated_channel(scid=0x41, psm=0x33)

        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.ConfigurationResponse(),
            L2capMatchers.ConfigurationRequest()).inAnyOrder()

    def test_config_unknown_options_with_hint(self):
        """
        L2CAP/COS/CFD/BV-12-C