[VOL-5284] resetFsm enters race during simultaneous delete device and device down ind

Change-Id: I451d48650702ab901a03a14fa4a965939f2c8250
Signed-off-by: Sridhar Ravindra <sridhar.ravindra@radisys.com>
diff --git a/internal/pkg/omcitst/omci_self_test_handler.go b/internal/pkg/omcitst/omci_self_test_handler.go
index f8def86..00a1eee 100755
--- a/internal/pkg/omcitst/omci_self_test_handler.go
+++ b/internal/pkg/omcitst/omci_self_test_handler.go
@@ -69,8 +69,8 @@
 	selfTestFsmMap  map[generated.ClassID]*fsmCb // The fsmCb is indexed by ME Class ID of the Test Action procedure
 	selfTestFsmLock sync.RWMutex
 
-	selfTestHandlerLock   sync.RWMutex
-	selfTestHandlerActive bool
+	SelfTestHandlerLock   sync.RWMutex
+	SelfTestHandlerActive bool
 	StopSelfTestModule    chan bool
 }
 
@@ -359,7 +359,6 @@
 func (selfTestCb *SelfTestControlBlock) waitForStopSelfTestModuleSignal(ctx context.Context) {
 	selfTestCb.SetSelfTestHandlerIsRunning(true)
 	<-selfTestCb.StopSelfTestModule // block on stop signal
-	selfTestCb.SetSelfTestHandlerIsRunning(false)
 
 	logger.Infow(ctx, "received stop signal - clean up start", log.Fields{"device-id": selfTestCb.deviceID})
 	selfTestCb.selfTestFsmLock.Lock()
@@ -381,16 +380,16 @@
 
 // SetSelfTestHandlerIsRunning sets the value to selfTestCb.selfTestHandlerActive
 func (selfTestCb *SelfTestControlBlock) SetSelfTestHandlerIsRunning(active bool) {
-	selfTestCb.selfTestHandlerLock.Lock()
-	defer selfTestCb.selfTestHandlerLock.Unlock()
-	selfTestCb.selfTestHandlerActive = active
+	selfTestCb.SelfTestHandlerLock.Lock()
+	defer selfTestCb.SelfTestHandlerLock.Unlock()
+	selfTestCb.SelfTestHandlerActive = active
 }
 
 // GetSelfTestHandlerIsRunning gets selfTestCb.selfTestHandlerActive
 func (selfTestCb *SelfTestControlBlock) GetSelfTestHandlerIsRunning() bool {
-	selfTestCb.selfTestHandlerLock.RLock()
-	defer selfTestCb.selfTestHandlerLock.RUnlock()
-	return selfTestCb.selfTestHandlerActive
+	selfTestCb.SelfTestHandlerLock.RLock()
+	defer selfTestCb.SelfTestHandlerLock.RUnlock()
+	return selfTestCb.SelfTestHandlerActive
 }
 
 // SelfTestRequestStart initiate Test Request handling procedure. The results are asynchronously conveyed on the respChan.