示例#1
0
    def test_config_unknown_options_with_hint(self):
        """
        L2CAP/COS/CFD/BV-12-C
        """
        self._setup_link_from_cert()
        self.cert_l2cap.reply_with_unknown_options_and_hint()

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

        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.ConfigurationResponse())
示例#2
0
    def test_disconnect_on_timeout(self):
        """
        L2CAP/COS/CED/BV-08-C
        """
        self._setup_link_from_cert()
        self.cert_l2cap.ignore_config_and_connections()

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

        assertThat(self.cert_l2cap.get_control_channel()).emitsNone(
            L2capMatchers.ConfigurationResponse())
示例#3
0
    def _open_channel(self,
                      signal_id=1,
                      scid=0x0101,
                      psm=0x33,
                      use_ertm=False):
        result = self._open_unvalidated_channel(signal_id, scid, psm, use_ertm)

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

        return result
示例#4
0
    def test_retry_config_after_rejection(self):
        """
        L2CAP/COS/CFD/BV-02-C
        """
        self._setup_link_from_cert()

        self.cert_l2cap.reply_with_unacceptable_parameters()

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

        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.ConfigurationResponse(),
            L2capMatchers.ConfigurationRequest(),
            L2capMatchers.ConfigurationRequest()).inAnyOrder()
示例#5
0
    def test_respond_configuration_request_ertm(self):
        """
        L2CAP/CMC/BV-02-C [Lower Tester Initiated Configuration of Enhanced Retransmission Mode]
        Verify the IUT can accept a Configuration Request from the Lower Tester containing an F&EC option
        that specifies Enhanced Retransmission Mode.
        """
        self._setup_link_from_cert()

        psm = 1
        scid = 0x0101
        self.retransmission_mode = l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM
        self.dut.l2cap.SetDynamicChannel(
            l2cap_facade_pb2.SetEnableDynamicChannelRequest(
                psm=psm, retransmission_mode=self.retransmission_mode))

        open_channel = l2cap_packets.ConnectionRequestBuilder(1, psm, scid)
        open_channel_l2cap = l2cap_packets.BasicFrameBuilder(1, open_channel)
        self.cert_send_b_frame(open_channel_l2cap)

        # TODO: Verify that the type should be ERTM
        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.ConfigurationResponse())
示例#6
0
 def verify_configuration_response(
         self, result=ConfigurationResponseResult.SUCCESS):
     assertThat(self._control_channel).emits(
         L2capMatchers.ConfigurationResponse(result))