Verify all clean function added for unit tests
[ric-plt/submgr.git] / pkg / control / sdl_e2SubsDb.go
index 3305e41..d1830de 100644 (file)
@@ -223,3 +223,14 @@ func (c *Control) RemoveAllSubscriptionsFromSdl() error {
        }
        return nil
 }
+
+func (c *Control) GetE2KeyCount() (int, error) {
+
+       // Get all keys
+       keys, err := c.e2SubsDb.GetAll(e2SubSdlNs)
+       if err != nil {
+               c.UpdateCounter(cSDLReadFailure)
+               return 0, fmt.Errorf("SDL: GetE2KeyCount(), GetAll(). Error while reading E2 subscriptions  keys from DBAAS %s\n", err.Error())
+       }
+       return len(keys), nil
+}