Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 1 | #Copyright 2017-present Open Networking Foundation |
| 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 | # limitations under the License. |
| 14 | |
| 15 | *** Settings *** |
| 16 | Documentation This test raises alarms using bbsimctl and verifies them using voltctl |
| 17 | Suite Setup Setup Suite |
| 18 | Suite Teardown Teardown Suite |
| 19 | Library Collections |
| 20 | Library String |
| 21 | Library OperatingSystem |
| 22 | Library XML |
| 23 | Library RequestsLibrary |
| 24 | Library ../../libraries/DependencyLibrary.py |
| 25 | Resource ../../libraries/onos.robot |
| 26 | Resource ../../libraries/voltctl.robot |
| 27 | Resource ../../libraries/utils.robot |
| 28 | Resource ../../libraries/k8s.robot |
| 29 | Resource ../../variables/variables.robot |
| 30 | |
| 31 | *** Variables *** |
| 32 | ${timeout} 60s |
| 33 | ${long_timeout} 420s |
| 34 | ${of_id} 0 |
| 35 | ${logical_id} 0 |
| 36 | ${has_dataplane} True |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 37 | ${setup_device} True |
| 38 | ${teardown_device} True |
| 39 | ${VOLTCTL_NAMESPACE} default |
| 40 | ${BBSIMCTL_NAMESPACE} voltha |
| 41 | ${VOLTCTL_POD_NAME} voltctl |
| 42 | ${BBSIMCTL_POD_NAME} bbsim |
| 43 | |
| 44 | *** Test Cases *** |
| 45 | Ensure required pods Running |
| 46 | [Documentation] Ensure the bbsim and voltctl pods are in Running state |
| 47 | [Tags] active |
| 48 | Validate Pod Status ${BBSIMCTL_POD_NAME} ${BBSIMCTL_NAMESPACE} Running |
| 49 | Validate Pod Status ${VOLTCTL_POD_NAME} ${VOLTCTL_NAMESPACE} Running |
| 50 | |
| 51 | ONU Discovery |
| 52 | [Documentation] Discover lists of ONUS, their Serial Numbers and device id, and pick one for subsequent tests |
| 53 | [Tags] active |
| 54 | #build onu sn list |
| 55 | ${List_ONU_Serial} Create List |
| 56 | Set Suite Variable ${List_ONU_Serial} |
| 57 | Build ONU SN List ${List_ONU_Serial} |
| 58 | Log ${List_ONU_Serial} |
| 59 | #validate onu states |
| 60 | Wait Until Keyword Succeeds ${long_timeout} 20s |
| 61 | ... Validate ONU Devices ENABLED ACTIVE REACHABLE ${List_ONU_Serial} |
| 62 | # Pick an ONU to use for subsequent test cases |
| 63 | ${onu_sn} Set Variable ${List_ONU_Serial}[0] |
| 64 | Set Suite Variable ${onu_sn} |
| 65 | ${onu_id} Get Device ID From SN ${onu_sn} |
| 66 | Set Suite Variable ${onu_id} |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 67 | ${parent_id} Get Parent ID From Device ID ${onu_id} |
| 68 | Set Suite Variable ${parent_id} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 69 | |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 70 | Test RaiseDriftOfWindowAlarm |
| 71 | [Documentation] Raise Drift Of Window Alarm and verify event received |
| 72 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 73 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_DRIFT_OF_WINDOW |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 74 | ... ${onu_sn} ONU_DRIFT_OF_WINDOW_RAISE_EVENT |
| 75 | # Note: PON is the zero value of the subCategory field, and causes it to be not present |
| 76 | Verify Header ${header} Voltha.openolt.ONU_DRIFT_OF_WINDOW\.(\\d+) ${EMPTY} |
| 77 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_DRIFT_OF_WINDOW_RAISE_EVENT |
| 78 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 79 | |
| 80 | Test ClearDriftOfWindowAlarm |
| 81 | [Documentation] Clear Drift Of Window Alarm and verify event received |
| 82 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 83 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_DRIFT_OF_WINDOW |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 84 | ... ${onu_sn} ONU_DRIFT_OF_WINDOW_CLEAR_EVENT |
| 85 | # Note: PON is the zero value of the subCategory field, and causes it to be not present |
| 86 | Verify Header ${header} Voltha.openolt.ONU_DRIFT_OF_WINDOW\.(\\d+) ${EMPTY} |
| 87 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_DRIFT_OF_WINDOW_CLEAR_EVENT |
| 88 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 89 | |
| 90 | Test RaiseDyingGaspAlarm |
| 91 | [Documentation] Raise Dying Gasp Alarm and verify event received |
| 92 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 93 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event DYING_GASP |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 94 | ... ${onu_sn} ONU_DYING_GASP_EVENT |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 95 | # Note: PON is the zero value of the subCategory field, and causes it to be not present |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 96 | Verify Header ${header} Voltha.openolt.ONU_DYING\.(\\d+) ${EMPTY} |
| 97 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_DYING_GASP_EVENT |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 98 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 99 | |
| 100 | Test RaiseLopcMissAlarm |
| 101 | [Documentation] Raise LOPC_MISS Alarm and verify event received |
| 102 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 103 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_ALARM_LOPC_MISS |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 104 | ... ${onu_sn} ONU_LOPC_MISS_RAISE_EVENT |
| 105 | # Note: PON is the zero value of the subCategory field, and causes it to be not present |
| 106 | Verify Header ${header} Voltha.openolt.ONU_LOPC_MISS\.(\\d+) ONU |
| 107 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOPC_MISS_RAISE_EVENT |
| 108 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 109 | |
| 110 | Test ClearLopcMissAlarm |
| 111 | [Documentation] Clear LOPC_MISS Alarm and verify event received |
| 112 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 113 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_ALARM_LOPC_MISS |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 114 | ... ${onu_sn} ONU_LOPC_MISS_CLEAR_EVENT |
| 115 | # Note: PON is the zero value of the subCategory field, and causes it to be not present |
| 116 | Verify Header ${header} Voltha.openolt.ONU_LOPC_MISS\.(\\d+) ONU |
| 117 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOPC_MISS_CLEAR_EVENT |
| 118 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 119 | |
| 120 | Test RaiseLopcMicErrorAlarm |
| 121 | [Documentation] Raise LOPC_MISS Alarm and verify event received |
| 122 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 123 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_ALARM_LOPC_MIC_ERROR |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 124 | ... ${onu_sn} ONU_LOPC_MIC_ERROR_RAISE_EVENT |
| 125 | # Note: PON is the zero value of the subCategory field, and causes it to be not present |
| 126 | Verify Header ${header} Voltha.openolt.ONU_LOPC_MIC_ERROR\.(\\d+) ONU |
| 127 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOPC_MIC_ERROR_RAISE_EVENT |
| 128 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 129 | |
| 130 | Test ClearLopcMicErrorAlarm |
| 131 | [Documentation] Clear LOPC_MISS Alarm and verify event received |
| 132 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 133 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_ALARM_LOPC_MIC_ERROR |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 134 | ... ${onu_sn} ONU_LOPC_MIC_ERROR_CLEAR_EVENT |
| 135 | # Note: PON is the zero value of the subCategory field, and causes it to be not present |
| 136 | Verify Header ${header} Voltha.openolt.ONU_LOPC_MIC_ERROR\.(\\d+) ONU |
| 137 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOPC_MIC_ERROR_CLEAR_EVENT |
| 138 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 139 | |
| 140 | Test RaiseLossOfBurstAlarm |
| 141 | [Documentation] Raise Loss Of Burst Alarm and verify event received |
| 142 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 143 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_ALARM_LOB |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 144 | ... ${onu_sn} ONU_LOSS_OF_BURST_RAISE_EVENT |
| 145 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_BURST\.(\\d+) ONU |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 146 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_BURST_RAISE_EVENT |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 147 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 148 | |
| 149 | Test ClearLossOfBurstAlarm |
| 150 | [Documentation] Clear Loss Of Burst Alarm and verify event received |
| 151 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 152 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_ALARM_LOB |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 153 | ... ${onu_sn} ONU_LOSS_OF_BURST_CLEAR_EVENT |
| 154 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_BURST\.(\\d+) ONU |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 155 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_BURST_CLEAR_EVENT |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 156 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 157 | |
| 158 | Test RaiseLossOfFrameAlarm |
| 159 | [Documentation] Raise Loss Of Frame Alarm and verify event received |
| 160 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 161 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_ALARM_LOFI |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 162 | ... ${onu_sn} ONU_LOSS_OF_FRAME_RAISE_EVENT |
| 163 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_FRAME\.(\\d+) ONU |
| 164 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_FRAME_RAISE_EVENT |
| 165 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 166 | |
| 167 | Test ClearLossOfFrameAlarm |
| 168 | [Documentation] Clear Loss Of Frame Alarm and verify event received |
| 169 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 170 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_ALARM_LOFI |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 171 | ... ${onu_sn} ONU_LOSS_OF_FRAME_CLEAR_EVENT |
| 172 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_FRAME\.(\\d+) ONU |
| 173 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_FRAME_CLEAR_EVENT |
| 174 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 175 | |
| 176 | Test RaiseLossOfKeySyncFailureAlarm |
| 177 | [Documentation] Raise Loss Of Key Sync Alarm and verify event received |
| 178 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 179 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_LOSS_OF_KEY_SYNC_FAILURE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 180 | ... ${onu_sn} ONU_LOSS_OF_KEY_SYNC_RAISE_EVENT |
| 181 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_KEY_SYNC\.(\\d+) ONU |
| 182 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_KEY_SYNC_RAISE_EVENT |
| 183 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 184 | |
| 185 | Test ClearLossOfKeySyncFailureAlarm |
| 186 | [Documentation] Clear Loss Of Key Sync Alarm and verify event received |
| 187 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 188 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_LOSS_OF_KEY_SYNC_FAILURE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 189 | ... ${onu_sn} ONU_LOSS_OF_KEY_SYNC_CLEAR_EVENT |
| 190 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_KEY_SYNC\.(\\d+) ONU |
| 191 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_KEY_SYNC_CLEAR_EVENT |
| 192 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 193 | |
| 194 | Test RaiseLossOfOmciChannelAlarm |
| 195 | [Documentation] Raise Loss Of Omci Channel Alarm and verify event received |
| 196 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 197 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_LOSS_OF_OMCI_CHANNEL |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 198 | ... ${onu_sn} ONU_LOSS_OF_OMCI_CHANNEL_RAISE_EVENT |
| 199 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_OMCI_CHANNEL\.(\\d+) ${EMPTY} |
| 200 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_OMCI_CHANNEL_RAISE_EVENT |
| 201 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 202 | |
| 203 | Test ClearLossOfOmciChannelAlarm |
| 204 | [Documentation] Clear Loss Of Omci Channel Alarm and verify event received |
| 205 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 206 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_LOSS_OF_OMCI_CHANNEL |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 207 | ... ${onu_sn} ONU_LOSS_OF_OMCI_CHANNEL_CLEAR_EVENT |
| 208 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_OMCI_CHANNEL\.(\\d+) ${EMPTY} |
| 209 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_OMCI_CHANNEL_CLEAR_EVENT |
| 210 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 211 | |
| 212 | Test RaiseLossOfPloamAlarm |
| 213 | [Documentation] Raise Loss Of Ploam Alarm and verify event received |
| 214 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 215 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_ALARM_LOAMI |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 216 | ... ${onu_sn} ONU_LOSS_OF_PLOAM_RAISE_EVENT |
| 217 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_PLOAM\.(\\d+) ONU |
| 218 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_PLOAM_RAISE_EVENT |
| 219 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 220 | |
| 221 | Test ClearLossOfPloamAlarm |
| 222 | [Documentation] Clear Loss Of Ploam Alarm and verify event received |
| 223 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 224 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_ALARM_LOAMI |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 225 | ... ${onu_sn} ONU_LOSS_OF_PLOAM_CLEAR_EVENT |
| 226 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_PLOAM\.(\\d+) ONU |
| 227 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_PLOAM_CLEAR_EVENT |
| 228 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 229 | |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 230 | # NOTE: ONU_ALARM_LOS a bit touchy as it seems to be automatically suppressed if |
| 231 | # multiples are sent in a row. It seems like the bbsim state machine is interacting |
| 232 | # with alarms, sometimes causing an ONU_ALARM_LOS to be sent, which then causes |
| 233 | # this test to be a duplicate, which in turn is suppressed and fails. So what we |
| 234 | # do is issue a CLEAR right before the RAISE. |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 235 | Test RaiseLossOfSignalAlarm |
| 236 | [Documentation] Raise Loss Of Signal Alarm and verify event received |
| 237 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 238 | Clear Onu Alarm ONU_ALARM_LOS ${onu_sn} |
| 239 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_ALARM_LOS |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 240 | ... ${onu_sn} ONU_LOSS_OF_SIGNAL_RAISE_EVENT |
| 241 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_SIGNAL\.(\\d+) ONU |
| 242 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_SIGNAL_RAISE_EVENT |
| 243 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 244 | |
| 245 | Test ClearLossOfSignalAlarm |
| 246 | [Documentation] Clear Loss Of Signal Alarm and verify event received |
| 247 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 248 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_ALARM_LOS |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 249 | ... ${onu_sn} ONU_LOSS_OF_SIGNAL_CLEAR_EVENT |
| 250 | Verify Header ${header} Voltha.openolt.ONU_LOSS_OF_SIGNAL\.(\\d+) ONU |
| 251 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_LOSS_OF_SIGNAL_CLEAR_EVENT |
| 252 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 253 | |
| 254 | Test RaisePonLossOfSignalAlarm |
| 255 | [Documentation] Raise Loss Of Signal Alarm and verify event received |
| 256 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 257 | ${header} ${deviceEvent} Raise Olt Alarm And Get Event OLT_PON_LOS |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 258 | ... 0 OLT_LOSS_OF_SIGNAL_RAISE_EVENT |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 259 | Verify Header ${header} Voltha.openolt.OLT_LOSS_OF_SIGNAL\.(\\d+) OLT |
| 260 | Should Be Equal ${deviceEvent}[deviceEventName] OLT_LOSS_OF_SIGNAL_RAISE_EVENT |
| 261 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 262 | |
| 263 | Test ClearPonLossOfSignalAlarm |
| 264 | [Documentation] Clear Loss Of Signal Alarm and verify event received |
| 265 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 266 | ${header} ${deviceEvent} Clear Olt Alarm And Get Event OLT_PON_LOS |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 267 | ... 0 OLT_LOSS_OF_SIGNAL_CLEAR_EVENT |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 268 | Verify Header ${header} Voltha.openolt.OLT_LOSS_OF_SIGNAL\.(\\d+) OLT |
| 269 | Should Be Equal ${deviceEvent}[deviceEventName] OLT_LOSS_OF_SIGNAL_CLEAR_EVENT |
| 270 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 271 | |
| 272 | Test RaiseProcessingErrorAlarm |
| 273 | # Not Implemented |
| 274 | [Documentation] Raise Processing Error Alarm and verify event received |
| 275 | [Tags] not-active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 276 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_PROCESSING_ERROR |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 277 | ... ${onu_sn} ONU_PROCESSING_ERROR_RAISE_EVENT |
| 278 | Verify Header ${header} Voltha.openolt.ONU_PROCESSING_ERROR\.(\\d+) ONU |
| 279 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_PROCESSING_ERROR_RAISE_EVENT |
| 280 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 281 | |
| 282 | Test ClearProcessingErrorAlarm |
| 283 | # Not Implemented |
| 284 | [Documentation] Clear Processing Error Alarm and verify event received |
| 285 | [Tags] not-active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 286 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_PROCESSING_ERROR |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 287 | ... ${onu_sn} ONU_PROCESSING_ERROR_CLEAR_EVENT |
| 288 | Verify Header ${header} Voltha.openolt.ONU_PROCESSING_ERROR\.(\\d+) ONU |
| 289 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_PROCESSING_ERROR_CLEAR_EVENT |
| 290 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 291 | |
| 292 | Test RaiseSignalDegradeAlarm |
| 293 | [Documentation] Raise Signal Degrade Alarm and verify event received |
| 294 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 295 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_SIGNAL_DEGRADE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 296 | ... ${onu_sn} ONU_SIGNAL_DEGRADE_RAISE_EVENT |
| 297 | Verify Header ${header} Voltha.openolt.ONU_SIGNAL_DEGRADE\.(\\d+) ${EMPTY} |
| 298 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_SIGNAL_DEGRADE_RAISE_EVENT |
| 299 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 300 | |
| 301 | Test ClearSignalDegradeAlarm |
| 302 | [Documentation] Clear Signal Degrade Alarm and verify event received |
| 303 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 304 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_SIGNAL_DEGRADE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 305 | ... ${onu_sn} ONU_SIGNAL_DEGRADE_CLEAR_EVENT |
| 306 | Verify Header ${header} Voltha.openolt.ONU_SIGNAL_DEGRADE\.(\\d+) ${EMPTY} |
| 307 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_SIGNAL_DEGRADE_CLEAR_EVENT |
| 308 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 309 | |
| 310 | Test RaiseSignalsFailureAlarm |
| 311 | [Documentation] Raise Signals Fail Alarm and verify event received |
| 312 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 313 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_SIGNALS_FAILURE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 314 | ... ${onu_sn} ONU_SIGNALS_FAIL_RAISE_EVENT |
| 315 | Verify Header ${header} Voltha.openolt.ONU_SIGNALS_FAIL\.(\\d+) ${EMPTY} |
| 316 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_SIGNALS_FAIL_RAISE_EVENT |
| 317 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 318 | |
| 319 | Test ClearSignalsFailureAlarm |
| 320 | [Documentation] Clear Signals Fail Alarm and verify event received |
| 321 | [Tags] active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 322 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_SIGNALS_FAILURE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 323 | ... ${onu_sn} ONU_SIGNALS_FAIL_CLEAR_EVENT |
| 324 | Verify Header ${header} Voltha.openolt.ONU_SIGNALS_FAIL\.(\\d+) ${EMPTY} |
| 325 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_SIGNALS_FAIL_CLEAR_EVENT |
| 326 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 327 | |
| 328 | Test RaiseStartupFailureAlarm |
| 329 | # Not Implemented |
| 330 | [Documentation] Raise Startup Failure Alarm and verify event received |
| 331 | [Tags] not-active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 332 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_STARTUP_FAILURE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 333 | ... ${onu_sn} ONU_STARTUP_FAILURE_RAISE_EVENT |
| 334 | Verify Header ${header} Voltha.openolt.ONU_STARTUP_FAILURE\.(\\d+) ONU |
| 335 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_STARTUP_FAILURE_RAISE_EVENT |
| 336 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 337 | |
| 338 | Test ClearStartupFailureAlarm |
| 339 | # Not Implemented |
| 340 | [Documentation] Clear Startup Failure Alarm and verify event received |
| 341 | [Tags] not-active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 342 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_STARTUP_FAILURE |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 343 | ... ${onu_sn} ONU_STARTUP_FAILURE_CLEAR_EVENT |
| 344 | Verify Header ${header} Voltha.openolt.ONU_STARTUP_FAILURE\.(\\d+) ONU |
| 345 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_STARTUP_FAILURE_CLEAR_EVENT |
| 346 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 347 | |
| 348 | Test RaiseTransmissionInterferenceAlarm |
| 349 | # Not Implemented |
| 350 | [Documentation] Raise Transmission Interference Alarm and verify event received |
| 351 | [Tags] not-active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 352 | ${header} ${deviceEvent} Raise Onu Alarm And Get Event ONU_TRANSMISSION_INTERFERENCE_WARNING |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 353 | ... ${onu_sn} ONU_TRANSMISSION_INTERFERENCE_RAISE_EVENT |
| 354 | Verify Header ${header} Voltha.openolt.ONU_TRANSMISSION_INTERFERENCE\.(\\d+) ONU |
| 355 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_TRANSMISSION_INTERFERENCE_RAISE_EVENT |
| 356 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 357 | |
| 358 | Test ClearTransmissionInterferenceAlarm |
| 359 | # Not Implemented |
| 360 | [Documentation] Clear Transmission Interference Alarm and verify event received |
| 361 | [Tags] not-active |
Scott Baker | e784000 | 2020-03-23 16:50:27 -0700 | [diff] [blame] | 362 | ${header} ${deviceEvent} Clear Onu Alarm And Get Event ONU_TRANSMISSION_INTERFERENCE_WARNING |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 363 | ... ${onu_sn} ONU_TRANSMISSION_INTERFERENCE_CLEAR_EVENT |
| 364 | Verify Header ${header} Voltha.openolt.ONU_TRANSMISSION_INTERFERENCE\.(\\d+) ONU |
| 365 | Should Be Equal ${deviceEvent}[deviceEventName] ONU_TRANSMISSION_INTERFERENCE_CLEAR_EVENT |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 366 | Should Be Equal ${deviceEvent}[resourceId] ${parent_id} |
| 367 | |
| 368 | *** Keywords *** |
| 369 | Setup Suite |
| 370 | [Documentation] Set up the test suite |
| 371 | Common Test Suite Setup |
| 372 | # Ensure the voltctl pod is deployed and running |
| 373 | Apply Kubernetes Resources ./voltctl.yaml ${VOLTCTL_NAMESPACE} |
| 374 | Wait Until Keyword Succeeds ${timeout} 5s |
| 375 | ... Validate Pod Status ${VOLTCTL_POD_NAME} ${VOLTCTL_NAMESPACE} Running |
| 376 | # Call Setup keyword in utils library to create and enable device |
| 377 | Run Keyword If ${setup_device} Setup |
| 378 | |
| 379 | Teardown Suite |
| 380 | [Documentation] Clean up devices if desired |
| 381 | ... kills processes and cleans up interfaces on src+dst servers |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 382 | Get ONOS Status ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 383 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | f8462be | 2020-11-05 13:38:42 -0800 | [diff] [blame] | 384 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 385 | Run Keyword If ${teardown_device} Test Empty Device List |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 386 | Run Keyword If ${teardown_device} Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 387 | ... device-remove ${of_id} |
| 388 | |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 389 | # Onu Alarms |
| 390 | |
| 391 | Raise Onu Alarm And Get Event |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 392 | [Documentation] Raise an Alarm and return event |
| 393 | [Arguments] ${name} ${sn} ${deviceEventName} |
| 394 | ${since} Get Current Time |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 395 | Raise Onu Alarm ${name} ${sn} |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 396 | ${header} ${deviceEvent} Get Device Event ${deviceEventName} ${since} |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 397 | ${LastEventPostTimestamp} Set Variable ${since} |
| 398 | Set Suite Variable ${LastEventPostTimestamp} |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 399 | [return] ${header} ${deviceEvent} |
| 400 | |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 401 | Clear Onu Alarm And Get Event |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 402 | [Documentation] Clear an Alarm and return event |
| 403 | [Arguments] ${name} ${sn} ${deviceEventName} |
| 404 | ${since} Get Current Time |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 405 | Clear Onu Alarm ${name} ${sn} |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 406 | ${header} ${deviceEvent} Get Device Event ${deviceEventName} ${since} |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 407 | ${LastEventPostTimestamp} Set Variable ${since} |
| 408 | Set Suite Variable ${LastEventPostTimestamp} |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 409 | [return] ${header} ${deviceEvent} |
| 410 | |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 411 | Raise Onu Alarm |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 412 | [Documentation] Raise an Alarm |
| 413 | [Arguments] ${name} ${sn} |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 414 | ${raiseOutput} Exec Pod ${BBSIMCTL_NAMESPACE} ${BBSIMCTL_POD_NAME} |
| 415 | ... bbsimctl onu alarms raise ${name} ${sn} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 416 | Should Contain ${raiseOutput} Alarm Indication Sent |
| 417 | |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 418 | Clear Onu Alarm |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 419 | [Documentation] Raise an Alarm |
| 420 | [Arguments] ${name} ${sn} |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 421 | ${raiseOutput} Exec Pod ${BBSIMCTL_NAMESPACE} ${BBSIMCTL_POD_NAME} |
| 422 | ... bbsimctl onu alarms clear ${name} ${sn} |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 423 | Should Contain ${raiseOutput} Alarm Indication Sent |
| 424 | |
| 425 | # Olt Alarms |
| 426 | |
| 427 | Raise Olt Alarm And Get Event |
| 428 | [Documentation] Raise an Alarm and return event |
| 429 | [Arguments] ${name} ${intf_id} ${deviceEventName} |
| 430 | ${since} Get Current Time |
| 431 | Raise Olt Alarm ${name} ${intf_id} |
| 432 | ${header} ${deviceEvent} Get Device Event ${deviceEventName} ${since} |
| 433 | ${LastEventPostTimestamp} Set Variable ${since} |
| 434 | Set Suite Variable ${LastEventPostTimestamp} |
| 435 | [return] ${header} ${deviceEvent} |
| 436 | |
| 437 | Clear Olt Alarm And Get Event |
| 438 | [Documentation] Clear an Alarm and return event |
| 439 | [Arguments] ${name} ${intf_id} ${deviceEventName} |
| 440 | ${since} Get Current Time |
| 441 | Clear Olt Alarm ${name} ${intf_id} |
| 442 | ${header} ${deviceEvent} Get Device Event ${deviceEventName} ${since} |
| 443 | ${LastEventPostTimestamp} Set Variable ${since} |
| 444 | Set Suite Variable ${LastEventPostTimestamp} |
| 445 | [return] ${header} ${deviceEvent} |
| 446 | |
| 447 | Raise Olt Alarm |
| 448 | [Documentation] Raise an Alarm |
| 449 | [Arguments] ${name} ${intf_id} |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 450 | ${raiseOutput} Exec Pod ${BBSIMCTL_NAMESPACE} ${BBSIMCTL_POD_NAME} |
| 451 | ... bbsimctl olt alarms raise ${name} ${intf_id} |
Scott Baker | ee03dd0 | 2020-03-12 11:48:06 -0700 | [diff] [blame] | 452 | Should Contain ${raiseOutput} Alarm Indication Sent |
| 453 | |
| 454 | Clear Olt Alarm |
| 455 | [Documentation] Raise an Alarm |
| 456 | [Arguments] ${name} ${intf_id} |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 457 | ${raiseOutput} Exec Pod ${BBSIMCTL_NAMESPACE} ${BBSIMCTL_POD_NAME} |
| 458 | ... bbsimctl olt alarms clear ${name} ${intf_id} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 459 | Should Contain ${raiseOutput} Alarm Indication Sent |
| 460 | |
| 461 | Get Device Event |
| 462 | [Documentation] Get the most recent alarm event from voltha.events |
| 463 | [Arguments] ${deviceEventName} ${since} |
| 464 | ${output} ${raiseErr} Exec Pod Separate Stderr ${VOLTCTL_NAMESPACE} ${VOLTCTL_POD_NAME} |
Girish Gowdra | 698a04b | 2020-11-23 10:24:43 -0800 | [diff] [blame] | 465 | ... voltctl event listen --show-body -t 1 -o json -f Titles=${deviceEventName} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 466 | ${json} To Json ${output} |
| 467 | ${count} Get Length ${json} |
| 468 | # If there is more than one event (which could happen if we quickly do a raise and a clear), |
| 469 | # then return the most recent one. |
| 470 | Should Be Larger Than ${count} 0 |
| 471 | ${lastIndex} Evaluate ${count}-1 |
| 472 | ${lastItem} Set Variable ${json}[${lastIndex}] |
| 473 | ${header} Set Variable ${lastItem}[header] |
| 474 | ${deviceEvent} Set Variable ${lastItem}[deviceEvent] |
| 475 | Log ${header} |
| 476 | Log ${deviceEvent} |
| 477 | [return] ${header} ${deviceEvent} |
| 478 | |
| 479 | Verify Header |
| 480 | [Documentation] Verify that a DeviceEvent's header is sane and the id matches regex |
Scott Baker | 27d04db | 2020-02-06 18:03:21 -0800 | [diff] [blame] | 481 | [Arguments] ${header} ${id} ${subCategory} |
| 482 | ${headerSubCategory} Evaluate $header.get("subCategory", "") |
| 483 | Should Be Equal ${headerSubCategory} ${subCategory} |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 484 | Should Be Equal ${header}[type] DEVICE_EVENT |
| 485 | Should Match Regexp ${header}[id] ${id} |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 486 | # TODO Timestamps are now RFC3339 date strings. Add Verification |
| 487 | ${reportedTs} Set Variable ${header}[reportedTs] |
| 488 | ${raisedTs} Set Variable ${header}[raisedTs] |
| 489 | Should Be Newer Than Or Equal To ${reportedTs} ${LastEventPostTimestamp} |
| 490 | Should Be Newer Than Or Equal To ${raisedTs} ${LastEventPostTimestamp} |