VOL-3433 Make timeouts of inter-adapter communication configurable

Change-Id: I3944737701546203262f95ffeb563716ff540c8a
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index ee8e1b3..2951a2f 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -318,7 +318,7 @@
 
 		// deadline context to ensure completion of background routines waited for
 		//20200721: 10s proved to be less in 8*8 ONU test on local vbox machine with debug, might be further adapted
-		deadline := time.Now().Add(30 * time.Second) //allowed run time to finish before execution
+		deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 		dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
 		dh.pOnuTP.resetTpProcessingErrorIndication()
@@ -374,7 +374,7 @@
 
 	if bTpModify := pDevEntry.updateOnuUniTpPath(uniID, ""); bTpModify {
 		// deadline context to ensure completion of background routines waited for
-		deadline := time.Now().Add(10 * time.Second) //allowed run time to finish before execution
+		deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 		dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
 		dh.pOnuTP.resetTpProcessingErrorIndication()
@@ -430,7 +430,7 @@
 
 	if bTpModify := pDevEntry.updateOnuUniTpPath(uniID, ""); bTpModify {
 		// deadline context to ensure completion of background routines waited for
-		deadline := time.Now().Add(10 * time.Second) //allowed run time to finish before execution
+		deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 		dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
 		dh.pOnuTP.resetTpProcessingErrorIndication()
@@ -634,7 +634,7 @@
 	for _, uniData := range pDevEntry.sOnuPersistentData.PersUniConfig {
 		// deadline context to ensure completion of background routines waited for
 		//20200721: 10s proved to be less in 8*8 ONU test on local vbox machine with debug, might be further adapted
-		deadline := time.Now().Add(30 * time.Second) //allowed run time to finish before execution
+		deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 		dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
 		dh.pOnuTP.resetTpProcessingErrorIndication()
@@ -703,7 +703,7 @@
 
 	// deadline context to ensure completion of background routines waited for
 	//20200721: 10s proved to be less in 8*8 ONU test on local vbox machine with debug, might be further adapted
-	deadline := time.Now().Add(30 * time.Second) //allowed run time to finish before execution
+	deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 	dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
 	pDevEntry.resetKvProcessingErrorIndication()
@@ -2061,7 +2061,7 @@
 
 	// deadline context to ensure completion of background routines waited for
 	//20200721: 10s proved to be less in 8*8 ONU test on local vbox machine with debug, might be further adapted
-	deadline := time.Now().Add(30 * time.Second) //allowed run time to finish before execution
+	deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 	dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
 	pDevEntry.resetKvProcessingErrorIndication()