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

Commit 8b660fc6 authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

L2capTest: Add 2/30 Fixed Channel Support am: ba7d72ee am: 8c4692f7

Change-Id: Id318606f9cecf7d5ce62397212c13e8ee1ff16b0
parents 89752ca5 8c4692f7
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -232,6 +232,10 @@ class L2capMatchers(object):
    def ExtractBasicFrameWithFcs(scid):
        return lambda packet: L2capMatchers._basic_frame_with_fcs_for(packet, scid)

    @staticmethod
    def InformationRequestWithType(info_type):
        return lambda packet: L2capMatchers._information_request_with_type(packet, info_type)

    @staticmethod
    def InformationResponseExtendedFeatures(supports_ertm=None,
                                            supports_streaming=None,
@@ -490,6 +494,17 @@ class L2capMatchers(object):
        request = l2cap_packets.LeFlowControlCreditView(frame)
        return request.GetCid() == cid

    @staticmethod
    def _information_request_with_type(packet, info_type):
        frame = L2capMatchers.control_frame_with_code(
            packet, CommandCode.INFORMATION_REQUEST)
        if frame is None:
            return None
        request = l2cap_packets.InformationRequestView(frame)
        if request.GetInfoType() != info_type:
            return None
        return request

    @staticmethod
    def _information_response_with_type(packet, info_type):
        frame = L2capMatchers.control_frame_with_code(
+14 −2
Original line number Diff line number Diff line
@@ -441,8 +441,6 @@ class L2capTest(GdBaseTestClass):
        type of Extended Features that correctly identifies that the Fixed
        Channels option is locally supported
        """
        asserts.skip("Fixed channel is not supported")

        self._setup_link_from_cert()
        control_channel = self.cert_l2cap.get_control_channel()

@@ -452,6 +450,20 @@ class L2capTest(GdBaseTestClass):
            L2capMatchers.InformationResponseExtendedFeatures(
                supports_fixed_channels=True))

    @metadata(
        pts_test_id="L2CAP/FIX/BV-01-C",
        pts_test_name="Fixed Channels Supported Information Request")
    def test_fixed_channels_supported_information_request(self):
        """
        Verify that the IUT can send an Information Request for the information
        type of Fixed Channels Supported.
        """
        self._setup_link_from_cert()
        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.InformationRequestWithType(
                l2cap_packets.InformationRequestInfoType.
                FIXED_CHANNELS_SUPPORTED))

    @metadata(
        pts_test_id="L2CAP/FOC/BV-01-C",
        pts_test_name="IUT Initiated Configuration of the FCS Option")