Fix for Submgr crash added
[ric-plt/submgr.git] / pkg / control / ut_ctrl_submgr_test.go
index 16c69b1..e514cb0 100644 (file)
@@ -55,6 +55,7 @@ func createSubmgrControl(srcId teststub.RmrSrcId, rtgSvc teststub.RmrRtgSvc) *te
        mainCtrl = &testingSubmgrControl{}
        mainCtrl.RmrControl.Init("SUBMGRCTL", srcId, rtgSvc)
        mainCtrl.c = NewControl()
+       mainCtrl.c.UTTesting = true
        mainCtrl.c.LoggerLevel = int(xapp.Logger.GetLevel())
        xapp.Logger.Debug("Test: LoggerLevel %v", mainCtrl.c.LoggerLevel)
        xapp.Logger.Debug("Replacing real db with test db")
@@ -72,7 +73,7 @@ func (mc *testingSubmgrControl) SimulateRestart(t *testing.T) {
        mainCtrl.c.registry.subIds = nil
        // Initialize subIds slice and subscription map
        mainCtrl.c.registry.Initialize()
-       restDuplicateCtrl.Init()
+       mainCtrl.c.restDuplicateCtrl.Init()
        // Read subIds and subscriptions from database
        subIds, register, err := mainCtrl.c.ReadAllSubscriptionsFromSdl()
        if err != nil {