Beispiel #1
0
    def run_internal(self, ntb_format):
        """
        Run DTS_19/DTS_25 test.

        @param ntb_format: Whether to send/receive an NTB16 or NTB32 frame.
                Possible values: NTB_FORMAT_16, NTB_FORMAT_32 (mbim_constants)

        """
        # Precondition
        _, _, _ = self.run_precondition(ntb_format)

        # Step 1
        loopback = loopback_sequence.LoopbackSequence(self.device_context)
        _, _, ndp_entries, _ = loopback.run(ntb_format=ntb_format)

        # Step 2
        if ntb_format == mbim_constants.NTB_FORMAT_16:
            if ndp_entries[-1].datagram_length != 0:
                mbim_errors.log_and_raise(
                        mbim_errors.MBIMComplianceAssertionError,
                        'ncm1.0:3.3.1#5')
        else:
            if ndp_entries[-1].datagram_length != 0:
                mbim_errors.log_and_raise(
                        mbim_errors.MBIMComplianceAssertionError,
                        'ncm1.0:3.3.2#5')
    def run_internal(self, ntb_format):
        """
        Run DTS_05/DTS_11 test.

        @param ntb_format: Whether to send/receive an NTB16 or NTB32 frame.
                Possible values: NTB_FORMAT_16, NTB_FORMAT_32 (mbim_constants)

        """
        # Precondition
        _, _, _ = self.run_precondition(ntb_format)

        # Step 1
        loopback = loopback_sequence.LoopbackSequence(self.device_context)
        nth_1, _, _, _ = loopback.run(ntb_format=ntb_format)

        # Step 2
        nth_2, _, _, _ = loopback.run(ntb_format=ntb_format)

        # Step 3
        if ntb_format == mbim_constants.NTB_FORMAT_16:
            if nth_2.sequence_number != nth_1.sequence_number + 1:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'ncm1.0:3.2.1#4')
        else:
            if nth_2.sequence_number != nth_1.sequence_number + 1:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'ncm1.0:3.2.2#4')
Beispiel #3
0
    def run_internal(self, ntb_format):
        """
        Run DTS_04/DTS_10 test.

        @param ntb_format: Whether to send/receive an NTB16 or NTB32 frame.
                Possible values: NTB_FORMAT_16, NTB_FORMAT_32 (mbim_constants)

        """
        # Precondition
        _, open_sequence, connect_sequence = self.run_precondition(ntb_format)

        # Step 1
        loopback = loopback_sequence.LoopbackSequence(self.device_context)
        _, _, _, _ = loopback.run(ntb_format=ntb_format)

        # Step 2
        open_sequence.run(ntb_format=ntb_format)
        connect_sequence.run()
        mbim_data_transfer.MBIMNtb.reset_sequence_number()

        # Step 3
        nth, _, _, _ = loopback.run(ntb_format=ntb_format)

        # Step 4
        if ntb_format == mbim_constants.NTB_FORMAT_16:
            if nth.sequence_number != 0:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'ncm1.0:3.2.1#3')
        else:
            if nth.sequence_number != 0:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'ncm1.0:3.2.2#3')
Beispiel #4
0
    def run_internal(self, ntb_format):
        """
        Run DTS_15/DTS_21 test.

        @param ntb_format: Whether to send/receive an NTB16 or NTB32 frame.
                Possible values: NTB_FORMAT_16, NTB_FORMAT_32 (mbim_constants)

        """
        # Precondition
        _, _, _ = self.run_precondition(ntb_format)

        # Step 1
        loopback = loopback_sequence.LoopbackSequence(self.device_context)
        _, ndp, _, _ = loopback.run(ntb_format=ntb_format)

        # Step 2
        if ntb_format == mbim_constants.NTB_FORMAT_16:
            if (ndp.length < 16) or (ndp.length % 4 != 0):
                mbim_errors.log_and_raise(
                        mbim_errors.MBIMComplianceAssertionError,
                        'ncm1.0:3.3.1#1')
        else:
            if (ndp.length < 32) or (ndp.length % 8 != 0):
                mbim_errors.log_and_raise(
                        mbim_errors.MBIMComplianceAssertionError,
                        'ncm1.0:3.3.2#1')
Beispiel #5
0
    def run_internal(self):
        """ Run DTS_01 test. """
        # Precondition
        _, _, _ = self.run_precondition(mbim_constants.NTB_FORMAT_16)

        # Step 1
        loopback = loopback_sequence.LoopbackSequence(self.device_context)
        _, _, _, payload = loopback.run(
            ntb_format=mbim_constants.NTB_FORMAT_16)

        # Step 2
        # Let's check the first byte of the first received payload to verify
        # that it is an IPv4 packet
        if payload[0][0] != 0x45:
            mbim_errors.log_and_raise(mbim_errors.MBIMComplianceAssertionError,
                                      'mbim1.0:3.2.1#5')
    def run_internal(self, ntb_format):
        """
        Run DTS_06/DTS_12 test.

        @param ntb_format: Whether to send/receive an NTB16 or NTB32 frame.
                Possible values: NTB_FORMAT_16, NTB_FORMAT_32 (mbim_constants)

        """
        # Precondition
        _, _, _ = self.run_precondition(ntb_format)

        # Step 1
        loopback = loopback_sequence.LoopbackSequence(self.device_context)
        nth, _, _, _ = loopback.run(ntb_format=ntb_format)

        # Step 2
        if ntb_format == mbim_constants.NTB_FORMAT_16:
            if nth.block_length > self.device_context.max_in_data_transfer_size:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'ncm1.0:3.2.1#5')
        else:
            if nth.block_length > self.device_context.max_in_data_transfer_size:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'ncm1.0:3.2.2#5')
Beispiel #7
0
    def run_internal(self, ntb_format):
        """
        Run DTS_14/DTS_20 test.

        @param ntb_format: Whether to send/receive an NTB16 or NTB32 frame.
                Possible values: NTB_FORMAT_16, NTB_FORMAT_32 (mbim_constants)

        """
        # Precondition
        _, _, _ = self.run_precondition(ntb_format)

        # Step 1
        loopback = loopback_sequence.LoopbackSequence(self.device_context)
        _, ndp, _, _ = loopback.run(ntb_format=ntb_format)

        # Step 2
        if ntb_format == mbim_constants.NTB_FORMAT_16:
            if ndp.signature != mbim_data_transfer.NDP_SIGNATURE_IPS_16:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'mbim1.0:7#1')
        else:
            if ndp.signature != mbim_data_transfer.NDP_SIGNATURE_IPS_32:
                mbim_errors.log_and_raise(
                    mbim_errors.MBIMComplianceAssertionError, 'mbim1.0:7#3')