[VOL-5460] abort selftest fsm if the instance isn't there for the onu
Change-Id: I7b39f71a92e75b4c469079f4e81a3ee1a2481249
Signed-off-by: Akash Reddy Kankanala <akash.kankanala@radisys.com>
diff --git a/VERSION b/VERSION
index 562510f..6d8424a 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.12.23
+2.12.24
diff --git a/internal/pkg/omcitst/omci_self_test_handler.go b/internal/pkg/omcitst/omci_self_test_handler.go
index cfa4536..fd98f6b 100755
--- a/internal/pkg/omcitst/omci_self_test_handler.go
+++ b/internal/pkg/omcitst/omci_self_test_handler.go
@@ -141,7 +141,12 @@
logger.Fatalw(ctx, "class-id-not-found", log.Fields{"device-id": selfTestCb.deviceID, "classID": classID})
}
instKeys := selfTestCb.pDevEntry.GetOnuDB().GetSortedInstKeys(ctx, classID)
-
+ if len(instKeys) == 0 {
+ logger.Errorw(ctx, "no instances found for class id", log.Fields{"device-id": selfTestCb.deviceID, "classID": classID})
+ selfTestCb.triggerFsmEvent(pFsmCb.fsm, selfTestEventAbort)
+ selfTestCb.submitFailureGetValueResponse(ctx, pFsmCb.respChan, extension.GetValueResponse_INTERNAL_ERROR, extension.GetValueResponse_ERROR, pFsmCb.reqMsg)
+ return
+ }
// TODO: Choosing the first index from the instance keys. For ANI-G, this is fine as there is only one ANI-G instance.
// How do we handle and report self test for multiple instances?
if err := selfTestCb.pDevEntry.GetDevOmciCC().SendSelfTestReq(ctx, classID, instKeys[0], selfTestCb.pDeviceHandler.GetOmciTimeout(),