Martin Cosyns | f88ed6e | 2020-12-02 10:30:10 +0100 | [diff] [blame^] | 1 | # Copyright 2020 ADTRAN, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | |
| 14 | keywords_to_skip = [ |
| 15 | 'connection_open', |
| 16 | 'connection_close', |
| 17 | 'connection_parameters_get', |
| 18 | 'connection_parameters_set', |
| 19 | 'get_keyword_names', |
| 20 | 'library_version_get', |
| 21 | 'dmi_version_get' |
| 22 | ] |
| 23 | |
| 24 | param_dicts = { |
| 25 | 'hw_event_mgmt_service_list_events': {'uuid': {'uuid': '1234-3456-5678'}}, |
| 26 | 'hw_event_mgmt_service_update_events_configuration': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 27 | 'hw_management_service_start_managing_device': {'name': 'otti', 'uri': {'uri': '1.2.3.4'}}, |
| 28 | 'hw_management_service_stop_managing_device': {'name': 'otti'}, |
| 29 | 'hw_management_service_get_managed_devices': None, |
| 30 | 'hw_management_service_get_physical_inventory': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 31 | 'hw_management_service_get_hw_component_info': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 32 | 'hw_management_service_set_hw_component_info': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 33 | 'hw_management_service_set_logging_endpoint': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 34 | 'hw_management_service_get_logging_endpoint': {'uuid': {'uuid': '1234-3456-5678'}}, |
| 35 | 'hw_management_service_set_msg_bus_endpoint': {'msgbus_endpoint': '1234-3456-5678'}, |
| 36 | 'hw_management_service_get_msg_bus_endpoint': None, |
| 37 | 'hw_management_service_get_loggable_entities': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 38 | 'hw_management_service_set_log_level': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 39 | 'hw_management_service_get_log_level': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 40 | 'hw_metrics_mgmt_service_list_metrics': {'uuid': {'uuid': '1234-3456-5678'}}, |
| 41 | 'hw_metrics_mgmt_service_update_metrics_configuration': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 42 | 'hw_metrics_mgmt_service_get_metric': {'meta_data': {'device_uuid': {'uuid': '1234-3456-5678'}}}, |
| 43 | 'sw_management_service_get_software_version': {'uuid': {'uuid': '1234-3456-5678'}}, |
| 44 | 'sw_management_service_download_image': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 45 | 'sw_management_service_activate_image': {'uuid': {'uuid': '1234-3456-5678'}}, |
| 46 | 'sw_management_service_revert_to_standby_image': {'uuid': {'uuid': '1234-3456-5678'}}, |
| 47 | 'sw_management_service_update_startup_configuration': {'device_uuid': {'uuid': '1234-3456-5678'}}, |
| 48 | } |
| 49 | |
| 50 | kafka_metric_messages = [ |
| 51 | { |
| 52 | 'message': b"\x08e\x12Y\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$96f716bd-9e72-5c39-9a79-58bb3821df19\x1a\x07cpu 0/1\x1a9\x08\x07\x10\x01\x18\t(\x012\x07percent:\x06\x08\xde\x96\x84\xfd\x05@\x88'J\x1bMETRIC_CPU_USAGE_PERCENTAGE", |
| 53 | 'metric': 'METRIC_CPU_USAGE_PERCENTAGE' |
| 54 | }, |
| 55 | { |
| 56 | 'message': b"\x08\xaf\x02\x12f\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$f14853c0-51e8-5f5a-8983-e8dc9c060f5d\x1a\x14storage-resource 0/1\x1a:\x08_\x10\x01\x18\t(\x012\x07percent:\x06\x08\xe3\x96\x84\xfd\x05@\x88'J\x1cMETRIC_DISK_USAGE_PERCENTAGE", |
| 57 | 'metric': 'METRIC_DISK_USAGE_PERCENTAGE' |
| 58 | }, |
| 59 | { |
| 60 | 'message': b"\x08\xf6\x03\x12b\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$81ba5a6b-b8b9-582e-9cea-a512ed6bd8ad\x1a\x10power-supply 0/1\x1a;\x082\x10\x01\x18\t(\x012\x07percent:\x06\x08\xe7\x96\x84\xfd\x05@\x88'J\x1dMETRIC_POWER_USAGE_PERCENTAGE", |
| 61 | 'metric': 'METRIC_POWER_USAGE_PERCENTAGE' |
| 62 | }, |
| 63 | { |
| 64 | 'message': b"\x08\xf6\x03\x12b\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$760d33cd-ad0d-541b-8014-272af0cfbff8\x1a\x10power-supply 0/2\x1a;\x082\x10\x01\x18\t(\x012\x07percent:\x06\x08\xe7\x96\x84\xfd\x05@\x88'J\x1dMETRIC_POWER_USAGE_PERCENTAGE", |
| 65 | 'metric': 'METRIC_POWER_USAGE_PERCENTAGE' |
| 66 | }, |
| 67 | { |
| 68 | 'message': b"\x08\x01\x12e\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$0f3a8a29-2b79-560a-a034-2255e0c85920\x1a\x13pluggable-fan 0/1/1\x1a+\x08\xc0%\x10\n\x18\t(\x012\x03rpm:\x06\x08\xeb\x96\x84\xfd\x05@\x88'J\x10METRIC_FAN_SPEED", |
| 69 | 'metric': 'METRIC_FAN_SPEED' |
| 70 | }, |
| 71 | { |
| 72 | 'message': b"\x08\x01\x12e\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$80d0e158-efc0-59ea-808d-e273d1c46099\x1a\x13pluggable-fan 0/1/2\x1a+\x08\xe5&\x10\n\x18\t(\x012\x03rpm:\x06\x08\xeb\x96\x84\xfd\x05@\x88'J\x10METRIC_FAN_SPEED", |
| 73 | 'metric': 'METRIC_FAN_SPEED' |
| 74 | }, |
| 75 | { |
| 76 | 'message': b"\x08\x01\x12e\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$15d3103a-36b2-5774-ae06-d2d59a2ab6e7\x1a\x13pluggable-fan 0/1/3\x1a+\x08\xc8$\x10\n\x18\t(\x012\x03rpm:\x06\x08\xeb\x96\x84\xfd\x05@\x88'J\x10METRIC_FAN_SPEED", |
| 77 | 'metric': 'METRIC_FAN_SPEED' |
| 78 | }, |
| 79 | { |
| 80 | 'message': b"\x08\xd8\x04\x12a\n&\n$4c411df2-22e6-58d2-b1bb-545a0263d18d\x12&\n$dc8c95f1-6b84-5e6d-b645-c76b02b7551b\x1a\x0ftemperature 0/1\x1aB\x085\x10\x08\x18\t(\x012\x0edegree Celsius:\x06\x08\xf0\x96\x84\xfd\x05@\x88'J\x1dMETRIC_INNER_SURROUNDING_TEMP", |
| 81 | 'metric': 'METRIC_INNER_SURROUNDING_TEMP' |
| 82 | }, |
| 83 | ] |
| 84 | |
| 85 | kafka_event_messages = [ |
| 86 | { |
| 87 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 88 | b'temperature 0/1\x10\xf7\x03\x1a\x06\x08\x80\x82\xcd\xfe\x05"\x10\n\x02\x10\x00\x12\n\n\x08\n\x02' |
| 89 | b'\x10A\x12\x02\x10\x01', |
| 90 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED' |
| 91 | }, |
| 92 | { |
| 93 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 94 | b'temperature 0/1\x10\xf8\x03\x1a\x06\x08\x80\x82\xcd\xfe\x05"\x00', |
| 95 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL_RECOVERED' |
| 96 | }, |
| 97 | { |
| 98 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 99 | b'temperature 0/1\x10\xf5\x03\x1a\x06\x08\xfe\xac\xdd\xfe\x05"\x10\n\x02\x10\x03\x12\n\n\x08\n\x02' |
| 100 | b'\x10\x02\x12\x02\x10\x01*\xcf\x01The system temperature of the physical entity ' |
| 101 | b'\'temperature 0/1\' has risen above power reduction active-threshold of 2 degree Celsius. Unit ' |
| 102 | b'operates out of specification. Correct service cannot be guaranteed.', |
| 103 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL' |
| 104 | }, |
| 105 | { |
| 106 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 107 | b'temperature 0/1\x10\xf6\x03\x1a\x06\x08\xfe\xac\xdd\xfe\x05"\x00*\x86\x01The system temperature ' |
| 108 | b'of the physical entity \'temperature 0/1\' has risen above thermal shutdown active-threshold ' |
| 109 | b'of 2 degree Celsius.', |
| 110 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_FATAL' |
| 111 | }, |
| 112 | { |
| 113 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 114 | b'temperature 0/1\x10\xf7\x03\x1a\x06\x08\xfe\xac\xdd\xfe\x05"\x10\n\x02\x10\x00\x12\n\n\x08\n\x02' |
| 115 | b'\x10\x02\x12\x02\x10\x01', |
| 116 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED' |
| 117 | }, |
| 118 | { |
| 119 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 120 | b'temperature 0/1\x10\xf5\x03\x1a\x06\x08\xfe\xac\xdd\xfe\x05"\x10\n\x02\x10\x03\x12\n\n\x08\n\x02' |
| 121 | b'\x10\x02\x12\x02\x10\x01*\xcf\x01The system temperature of the physical entity ' |
| 122 | b'\'temperature 0/1\' has risen above power reduction active-threshold of 2 degree Celsius. Unit ' |
| 123 | b'operates out of specification. Correct service cannot be guaranteed.', |
| 124 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL' |
| 125 | }, |
| 126 | { |
| 127 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 128 | b'temperature 0/1\x10\xf7\x03\x1a\x06\x08\xfe\xac\xdd\xfe\x05"\x10\n\x02\x10\x00\x12\n\n\x08\n\x02' |
| 129 | b'\x10\x02\x12\x02\x10\x01', |
| 130 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL_RECOVERED' |
| 131 | }, |
| 132 | { |
| 133 | 'message': b'\na\n&\n$84f46fde-89fa-5a2f-be4a-6d18abe6e953\x12&\n$368c6f41-564c-5821-8e15-721f818387fc\x1a\x0f' |
| 134 | b'temperature 0/1\x10\xf5\x03\x1a\x06\x08\xfe\xac\xdd\xfe\x05"\x10\n\x02\x10\x03\x12\n\n\x08\n\x02' |
| 135 | b'\x10\x02\x12\x02\x10\x01*\xcf\x01The system temperature of the physical entity ' |
| 136 | b'\'temperature 0/1\' has risen above power reduction active-threshold of 2 degree Celsius. Unit ' |
| 137 | b'operates out of specification. Correct service cannot be guaranteed.', |
| 138 | 'event': 'EVENT_HW_DEVICE_TEMPERATURE_ABOVE_CRITICAL' |
| 139 | }, |
| 140 | ] |