VOL-2970 - Improved readability & traceability of startup code.
Changed Start() function to implement majority of the startup functionality, with less helpers. Start() also defines local variables for each component created, to avoid accidentally using a component that isn't ready.
Also merged the rwCore into the Core.
Also changed Core to cancel a local context to on shutdown, and then wait for shutdown to complete.
Change-Id: I285e8486773476531e20ec352ff85a1b145432bf
diff --git a/rw_core/core/device/logical_agent_test.go b/rw_core/core/device/logical_agent_test.go
index 64c42b5..e562400 100644
--- a/rw_core/core/device/logical_agent_test.go
+++ b/rw_core/core/device/logical_agent_test.go
@@ -487,23 +487,13 @@
if err = lda.kmp.Start(); err != nil {
logger.Fatal("Cannot start InterContainerProxy")
}
- if err = adapterMgr.Start(context.Background()); err != nil {
- logger.Fatal("Cannot start adapterMgr")
- }
- lda.deviceMgr.Start(context.Background())
- lda.logicalDeviceMgr.Start(context.Background())
+ adapterMgr.Start(context.Background())
}
func (lda *LDATest) stopAll() {
if lda.kClient != nil {
lda.kClient.Stop()
}
- if lda.logicalDeviceMgr != nil {
- lda.logicalDeviceMgr.Stop(context.Background())
- }
- if lda.deviceMgr != nil {
- lda.deviceMgr.Stop(context.Background())
- }
if lda.kmp != nil {
lda.kmp.Stop()
}