| #!/usr/bin/env python3 |
| |
| from sys import exit |
| from errno import ENXIO |
| |
| from helper import test_enums |
| |
| import gi |
| gi.require_version('Hinawa', '3.0') |
| from gi.repository import Hinawa |
| |
| fw_tcode_enumerators = ( |
| 'WRITE_QUADLET_REQUEST', |
| 'WRITE_BLOCK_REQUEST', |
| 'WRITE_RESPONSE', |
| 'READ_QUADLET_REQUEST', |
| 'READ_BLOCK_REQUEST', |
| 'READ_QUADLET_RESPONSE', |
| 'READ_BLOCK_RESPONSE', |
| 'CYCLE_START', |
| 'LOCK_REQUEST', |
| 'STREAM_DATA', |
| 'LOCK_RESPONSE', |
| 'LOCK_MASK_SWAP', |
| 'LOCK_COMPARE_SWAP', |
| 'LOCK_FETCH_ADD', |
| 'LOCK_LITTLE_ADD', |
| 'LOCK_BOUNDED_ADD', |
| 'LOCK_WRAP_ADD', |
| 'LOCK_VENDOR_DEPENDENT', |
| ) |
| |
| fw_rcode_enumerators = ( |
| 'COMPLETE', |
| 'CONFLICT_ERROR', |
| 'DATA_ERROR', |
| 'TYPE_ERROR', |
| 'ADDRESS_ERROR', |
| 'SEND_ERROR', |
| 'CANCELLED', |
| 'BUSY', |
| 'GENERATION', |
| 'NO_ACK', |
| ) |
| |
| fw_req_error_enumerations = ( |
| 'CONFLICT_ERROR', |
| 'DATA_ERROR', |
| 'TYPE_ERROR', |
| 'ADDRESS_ERROR', |
| 'SEND_ERROR', |
| 'CANCELLED', |
| 'BUSY', |
| 'GENERATION', |
| 'NO_ACK', |
| 'INVALID', |
| ) |
| |
| fw_node_error_enumerators = ( |
| 'DISCONNECTED', |
| 'OPENED', |
| 'NOT_OPENED', |
| 'FAILED', |
| ) |
| |
| fw_resp_error_enumerations = ( |
| 'FAILED', |
| 'RESERVED', |
| 'ADDR_SPACE_USED', |
| ) |
| |
| fw_fcp_error_enumerators = ( |
| 'TIMEOUT', |
| 'LARGE_RESP', |
| 'ABORTED', |
| ) |
| |
| types = { |
| Hinawa.FwTcode: fw_tcode_enumerators, |
| Hinawa.FwRcode: fw_rcode_enumerators, |
| Hinawa.FwReqError: fw_req_error_enumerations, |
| Hinawa.FwNodeError: fw_node_error_enumerators, |
| Hinawa.FwRespError: fw_resp_error_enumerations, |
| Hinawa.FwFcpError: fw_fcp_error_enumerators, |
| } |
| |
| for target_type, enumerations in types.items(): |
| if not test_enums(target_type, enumerations): |
| exit(ENXIO) |