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