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

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

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

Change-Id: I497030e248a436015e42be5831f63a646d508e26
parents e03b4b15 ba7d72ee
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -232,6 +232,10 @@ class L2capMatchers(object):
    def ExtractBasicFrameWithFcs(scid):
    def ExtractBasicFrameWithFcs(scid):
        return lambda packet: L2capMatchers._basic_frame_with_fcs_for(packet, 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
    @staticmethod
    def InformationResponseExtendedFeatures(supports_ertm=None,
    def InformationResponseExtendedFeatures(supports_ertm=None,
                                            supports_streaming=None,
                                            supports_streaming=None,
@@ -490,6 +494,17 @@ class L2capMatchers(object):
        request = l2cap_packets.LeFlowControlCreditView(frame)
        request = l2cap_packets.LeFlowControlCreditView(frame)
        return request.GetCid() == cid
        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
    @staticmethod
    def _information_response_with_type(packet, info_type):
    def _information_response_with_type(packet, info_type):
        frame = L2capMatchers.control_frame_with_code(
        frame = L2capMatchers.control_frame_with_code(
+14 −2
Original line number Original line Diff line number Diff line
@@ -441,8 +441,6 @@ class L2capTest(GdBaseTestClass):
        type of Extended Features that correctly identifies that the Fixed
        type of Extended Features that correctly identifies that the Fixed
        Channels option is locally supported
        Channels option is locally supported
        """
        """
        asserts.skip("Fixed channel is not supported")

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


@@ -452,6 +450,20 @@ class L2capTest(GdBaseTestClass):
            L2capMatchers.InformationResponseExtendedFeatures(
            L2capMatchers.InformationResponseExtendedFeatures(
                supports_fixed_channels=True))
                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(
    @metadata(
        pts_test_id="L2CAP/FOC/BV-01-C",
        pts_test_id="L2CAP/FOC/BV-01-C",
        pts_test_name="IUT Initiated Configuration of the FCS Option")
        pts_test_name="IUT Initiated Configuration of the FCS Option")