1 # Copyright (c) 2014 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 5 """ 6 CM_04 Validation of |transaction_id| in Modem's Response to MBIM_COMMAND_MSG 7 8 Reference: 9 [1] Universal Serial Bus Communication Class MBIM Compliance Testing: 38 10 http://www.usb.org/developers/docs/devclass_docs/MBIM-Compliance-1.0.pdf 11 """ 12 import common 13 from autotest_lib.client.cros.cellular.mbim_compliance import mbim_errors 14 from autotest_lib.client.cros.cellular.mbim_compliance.sequences \ 15 import mbim_cid_device_caps_sequence 16 from autotest_lib.client.cros.cellular.mbim_compliance.sequences \ 17 import mbim_open_generic_sequence 18 from autotest_lib.client.cros.cellular.mbim_compliance.tests import test 19 20 21 class CM04Test(test.Test): 22 """ Implement the CM_04 test. """ 23 24 def run_internal(self): 25 """ Run CM_04 test. """ 26 # Precondition 27 mbim_open_generic_sequence.MBIMOpenGenericSequence( 28 self.test_context).run() 29 30 # Step 1 31 command_message, response_message = ( 32 mbim_cid_device_caps_sequence.MBIMCIDDeviceCapsSequence( 33 self.test_context).run()) 34 # Validate |transaction_id| in the response to MBIM_COMMAND_MSG. 35 if response_message.transaction_id != command_message.transaction_id: 36 mbim_errors.log_and_raise(mbim_errors.MBIMComplianceAssertionError, 37 'mbim1.0:9.4.3') 38