# Path: pyipmi/msgs/message.py
# class BaseField(object):
# class ByteArray(BaseField):
# class VariableByteArray(ByteArray):
# class UnsignedInt(BaseField):
# class String(BaseField):
# class CompletionCode(UnsignedInt):
# class UnsignedIntMask(UnsignedInt):
# class Timestamp(UnsignedInt):
# class Conditional(object):
# class Optional(object):
# class RemainingBytes(BaseField):
# class Bitfield(BaseField):
#     class Bit(object):
#     class ReservedBit(Bit):
#     class BitWrapper(object):
# class GroupExtensionIdentifier(UnsignedInt):
# class Message(object):
#     def __init__(self, name, length, default=None):
#     def decode(self, obj, data):
#     def encode(self, obj, data):
#     def create(self):
#     def __init__(self, name, length, default=None):
#     def _length(self, obj):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, name, length_func):
#     def _length(self, obj):
#     def create(self):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, name='completion_code'):
#     def decode(self, obj, data):
#     def __init__(self, name, length, mask, default=None):
#     def __init__(self, name):
#     def __init__(self, cond_fn, field):
#     def __getattr__(self, name):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, field):
#     def __getattr__(self, name):
#     def decode(self, obj, data):
#     def encode(self, obj, data):
#     def create(self):
#     def __init__(self, name):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#         def __init__(self, name, width=1, default=None):
#         def __init__(self, width, default=0):
#         def __init__(self, bits, length):
#         def __str__(self):
#         def __int__(self):
#         def _get_value(self):
#         def _set_value(self, value):
#     def __init__(self, name, length, *bits):
#     def _precalc_offsets(self):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, name='picmg_identifier', value=None):
#     def __init__(self, *args, **kwargs):
#     def _set_field(self, name, value):
#     def __str__(self):
#     def _create_fields(self):
#     def _pack(self):
#     def _encode(self):
#     def _decode(self, data):
#     def _is_request(self):
#     def _is_response(self):
#     RESERVED_FIELD_NAMES = ['cmdid', 'netfn', 'lun', 'group_extension']


from array import array
from nose.tools import eq_
from pyipmi.msgs import decode_message
import pyipmi.msgs.bmc
    eq_(m.result, 0x55)
    eq_(int(m.status), 0x00)


def test_getselftestresults_decode_test_fail_not_implemented_rsp():
    m = pyipmi.msgs.bmc.GetSelftestResultsRsp()
    decode_message(m, b'\x00\x56\x00')
    eq_(m.completion_code, 0x00)
    eq_(m.result, 0x56)
    eq_(int(m.status), 0x00)


def test_getselftestresults_decode_test_fail_corrupted_sel_rsp():
    m = pyipmi.msgs.bmc.GetSelftestResultsRsp()
    decode_message(m, b'\x00\x57\x80')
    eq_(m.completion_code, 0x00)
    eq_(m.result, 0x57)
    eq_(int(m.status), 0x80)
    eq_(m.status.cannot_access_sel_device, 1)
    eq_(m.status.cannot_access_sdr_device, 0)
    eq_(m.status.cannot_access_bmc_fru_device, 0)
    eq_(m.status.ipmb_signal_lines_do_not_respond, 0)
    eq_(m.status.sdr_repository_empty, 0)
    eq_(m.status.internal_use_area_corrupted, 0)
    eq_(m.status.controller_bootblock_corrupted, 0)
    eq_(m.status.controller_firmware_corrupted, 0)


def test_getselftestresults_decode_test_fail_corrupted_sdr_rsp():
    m = pyipmi.msgs.bmc.GetSelftestResultsRsp()

# Path: pyipmi/msgs/message.py
# class BaseField(object):
# class ByteArray(BaseField):
# class VariableByteArray(ByteArray):
# class UnsignedInt(BaseField):
# class String(BaseField):
# class CompletionCode(UnsignedInt):
# class UnsignedIntMask(UnsignedInt):
# class Timestamp(UnsignedInt):
# class Conditional(object):
# class Optional(object):
# class RemainingBytes(BaseField):
# class Bitfield(BaseField):
#     class Bit(object):
#     class ReservedBit(Bit):
#     class BitWrapper(object):
# class GroupExtensionIdentifier(UnsignedInt):
# class Message(object):
#     def __init__(self, name, length, default=None):
#     def decode(self, obj, data):
#     def encode(self, obj, data):
#     def create(self):
#     def __init__(self, name, length, default=None):
#     def _length(self, obj):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, name, length_func):
#     def _length(self, obj):
#     def create(self):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, name='completion_code'):
#     def decode(self, obj, data):
#     def __init__(self, name, length, mask, default=None):
#     def __init__(self, name):
#     def __init__(self, cond_fn, field):
#     def __getattr__(self, name):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, field):
#     def __getattr__(self, name):
#     def decode(self, obj, data):
#     def encode(self, obj, data):
#     def create(self):
#     def __init__(self, name):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#         def __init__(self, name, width=1, default=None):
#         def __init__(self, width, default=0):
#         def __init__(self, bits, length):
#         def __str__(self):
#         def __int__(self):
#         def _get_value(self):
#         def _set_value(self, value):
#     def __init__(self, name, length, *bits):
#     def _precalc_offsets(self):
#     def encode(self, obj, data):
#     def decode(self, obj, data):
#     def create(self):
#     def __init__(self, name='picmg_identifier', value=None):
#     def __init__(self, *args, **kwargs):
#     def _set_field(self, name, value):
#     def __str__(self):
#     def _create_fields(self):
#     def _pack(self):
#     def _encode(self):
#     def _decode(self, data):
#     def _is_request(self):
#     def _is_response(self):
#     RESERVED_FIELD_NAMES = ['cmdid', 'netfn', 'lun', 'group_extension']


# Path: tests/msgs/test_bmc.py
from array import array
from nose.tools import eq_
from pyipmi.msgs import decode_message
import pyipmi.msgs.bmc

    eq_(m.result, 0x55)
    eq_(int(m.status), 0x00)


def test_getselftestresults_decode_test_fail_not_implemented_rsp():
    m = pyipmi.msgs.bmc.GetSelftestResultsRsp()
    decode_message(m, b'\x00\x56\x00')
    eq_(m.completion_code, 0x00)
    eq_(m.result, 0x56)
    eq_(int(m.status), 0x00)


def test_getselftestresults_decode_test_fail_corrupted_sel_rsp():
    m = pyipmi.msgs.bmc.GetSelftestResultsRsp()
    decode_message(m, b'\x00\x57\x80')
    eq_(m.completion_code, 0x00)
    eq_(m.result, 0x57)
    eq_(int(m.status), 0x80)
    eq_(m.status.cannot_access_sel_device, 1)
    eq_(m.status.cannot_access_sdr_device, 0)
    eq_(m.status.cannot_access_bmc_fru_device, 0)
    eq_(m.status.ipmb_signal_lines_do_not_respond, 0)
    eq_(m.status.sdr_repository_empty, 0)
    eq_(m.status.internal_use_area_corrupted, 0)
    eq_(m.status.controller_bootblock_corrupted, 0)
    eq_(m.status.controller_firmware_corrupted, 0)


def test_getselftestresults_decode_test_fail_corrupted_sdr_rsp():
    m = pyipmi.msgs.bmc.GetSelftestResultsRsp()

    decode_message(m, b'\x00\x57\x40')