1# Copyright 2015 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import common 6from autotest_lib.client.cros.cellular.mbim_compliance \ 7 import mbim_command_message 8from autotest_lib.client.cros.cellular.mbim_compliance import mbim_errors 9from autotest_lib.client.cros.cellular.mbim_compliance import mbim_test_base 10from autotest_lib.client.cros.cellular.mbim_compliance.sequences \ 11 import get_descriptors_sequence 12from autotest_lib.client.cros.cellular.mbim_compliance.sequences \ 13 import mbim_cid_device_caps_sequence 14from autotest_lib.client.cros.cellular.mbim_compliance.sequences \ 15 import mbim_open_generic_sequence 16 17 18class cellular_MbimComplianceCM15(mbim_test_base.MbimTestBase): 19 """ 20 CM_15 Validation of message fragmentation ability. 21 22 This test verifies that the function follows the rules of control message 23 fragmentation. 24 25 Reference: 26 [1] Universal Serial Bus Communication Class MBIM Compliance Testing: 43 27 http://www.usb.org/developers/docs/devclass_docs/MBIM-Compliance-1.0.pdf 28 29 """ 30 version = 1 31 32 def run_internal(self): 33 """ Run CM_15 test. """ 34 # Precondition 35 descriptors = get_descriptors_sequence.GetDescriptorsSequence( 36 self.device_context).run() 37 self.device_context.update_descriptor_cache(descriptors) 38 open_sequence = mbim_open_generic_sequence.MBIMOpenGenericSequence( 39 self.device_context) 40 open_sequence.run(max_control_transfer_size=64) 41 42 # Step 1 43 caps_sequence = mbim_cid_device_caps_sequence.MBIMCIDDeviceCapsSequence( 44 self.device_context) 45 _, response_message = caps_sequence.run() 46 if not isinstance(response_message, 47 mbim_command_message.MBIMDeviceCapsInfo): 48 mbim_errors.log_and_raise(mbim_errors.MBIMComplianceAssertionError, 49 'mbim1.0:9.2') 50