Revert "[VOL-3069]Pass Context in methods which are performing logging and need the context"

This reverts commit 3c425fbeabed17ec8dad437678b4d105deaf2fbe.

Reason for revert: Merging higher-priority patches first.

Change-Id: Iaa03a5977357dcd86de358d76e90cc54cd6b1fa5
diff --git a/pkg/db/backend_test.go b/pkg/db/backend_test.go
index 98b72a0..b8c66bd 100644
--- a/pkg/db/backend_test.go
+++ b/pkg/db/backend_test.go
@@ -41,37 +41,35 @@
 )
 
 func TestMain(m *testing.M) {
-	ctx := context.Background()
 	var err error
 	embedEtcdServerPort, err = freeport.GetFreePort()
 	if err != nil {
-		logger.Fatal(ctx, err)
+		logger.Fatal(err)
 	}
 	dummyEtcdServerPort, err = freeport.GetFreePort()
 	if err != nil {
-		logger.Fatal(ctx, err)
+		logger.Fatal(err)
 	}
 	peerPort, err := freeport.GetFreePort()
 	if err != nil {
-		logger.Fatal(ctx, err)
+		logger.Fatal(err)
 	}
-	etcdServer := mocks.StartEtcdServer(ctx, mocks.MKConfig(ctx, "voltha.db.test", embedEtcdServerPort, peerPort, "voltha.lib.db", "error"))
+	etcdServer := mocks.StartEtcdServer(mocks.MKConfig("voltha.db.test", embedEtcdServerPort, peerPort, "voltha.lib.db", "error"))
 	res := m.Run()
 
-	etcdServer.Stop(ctx)
+	etcdServer.Stop()
 	os.Exit(res)
 }
 
 func provisionBackendWithEmbeddedEtcdServer(t *testing.T) *Backend {
-	ctx := context.Background()
-	backend := NewBackend(ctx, "etcd", embedEtcdServerHost+":"+strconv.Itoa(embedEtcdServerPort), defaultTimeout, defaultPathPrefix)
+	backend := NewBackend("etcd", embedEtcdServerHost+":"+strconv.Itoa(embedEtcdServerPort), defaultTimeout, defaultPathPrefix)
 	assert.NotNil(t, backend)
 	assert.NotNil(t, backend.Client)
 	return backend
 }
 
 func provisionBackendWithDummyEtcdServer(t *testing.T) *Backend {
-	backend := NewBackend(context.Background(), "etcd", embedEtcdServerHost+":"+strconv.Itoa(dummyEtcdServerPort), defaultTimeout, defaultPathPrefix)
+	backend := NewBackend("etcd", embedEtcdServerHost+":"+strconv.Itoa(dummyEtcdServerPort), defaultTimeout, defaultPathPrefix)
 	assert.NotNil(t, backend)
 	assert.NotNil(t, backend.Client)
 	return backend
@@ -80,7 +78,7 @@
 // Create instance using Etcd Kvstore
 func TestNewBackend_EtcdKvStore(t *testing.T) {
 	address := embedEtcdServerHost + ":" + strconv.Itoa(embedEtcdServerPort)
-	backend := NewBackend(context.Background(), "etcd", address, defaultTimeout, defaultPathPrefix)
+	backend := NewBackend("etcd", address, defaultTimeout, defaultPathPrefix)
 
 	// Verify all attributes of backend have got set correctly
 	assert.NotNil(t, backend)
@@ -96,7 +94,7 @@
 
 // Create instance using Consul Kvstore
 func TestNewBackend_ConsulKvStore(t *testing.T) {
-	backend := NewBackend(context.Background(), "consul", embedEtcdServerHost+":"+strconv.Itoa(embedEtcdServerPort), defaultTimeout, defaultPathPrefix)
+	backend := NewBackend("consul", embedEtcdServerHost+":"+strconv.Itoa(embedEtcdServerPort), defaultTimeout, defaultPathPrefix)
 
 	// Verify kvstore type attribute of backend has got set correctly
 	assert.NotNil(t, backend)
@@ -106,7 +104,7 @@
 
 // Create instance using Invalid Kvstore; instance creation should fail
 func TestNewBackend_InvalidKvstore(t *testing.T) {
-	backend := NewBackend(context.Background(), "unknown", embedEtcdServerHost+":"+strconv.Itoa(embedEtcdServerPort), defaultTimeout, defaultPathPrefix)
+	backend := NewBackend("unknown", embedEtcdServerHost+":"+strconv.Itoa(embedEtcdServerPort), defaultTimeout, defaultPathPrefix)
 
 	assert.NotNil(t, backend)
 	assert.Nil(t, backend.Client)
@@ -114,7 +112,7 @@
 
 func TestMakePath(t *testing.T) {
 	backend := provisionBackendWithEmbeddedEtcdServer(t)
-	path := backend.makePath(context.Background(), "Suffix")
+	path := backend.makePath("Suffix")
 	assert.Equal(t, defaultPathPrefix+"/Suffix", path)
 }
 
@@ -140,7 +138,7 @@
 func TestEnableLivenessChannel_EmbeddedEtcdServer_BeforeLivenessCheck(t *testing.T) {
 	backend := provisionBackendWithEmbeddedEtcdServer(t)
 
-	alive := backend.EnableLivenessChannel(context.Background())
+	alive := backend.EnableLivenessChannel()
 	assert.NotNil(t, alive)
 	assert.Equal(t, 1, len(alive))
 	assert.Equal(t, false, <-alive)
@@ -154,7 +152,7 @@
 	defer cancel()
 	backend.PerformLivenessCheck(ctx)
 
-	alive := backend.EnableLivenessChannel(ctx)
+	alive := backend.EnableLivenessChannel()
 	assert.NotNil(t, alive)
 	assert.Equal(t, 1, len(alive))
 	assert.Equal(t, true, <-alive)
@@ -165,14 +163,14 @@
 func TestUpdateLiveness_AliveStatusChange(t *testing.T) {
 	backend := provisionBackendWithEmbeddedEtcdServer(t)
 	// Enable Liveness Channel and verify initial state is not-alive
-	aliveState := backend.EnableLivenessChannel(context.Background())
+	aliveState := backend.EnableLivenessChannel()
 	assert.NotNil(t, aliveState)
 	assert.Equal(t, 1, len(backend.liveness))
 	assert.Equal(t, false, <-backend.liveness)
 	lastUpdateTime := backend.lastLivenessTime
 
 	// Update with changed alive state. Verify alive state push & liveness time update
-	backend.updateLiveness(context.Background(), true)
+	backend.updateLiveness(true)
 	assert.Equal(t, 1, len(backend.liveness))
 	assert.Equal(t, true, <-backend.liveness)
 	assert.NotEqual(t, lastUpdateTime, backend.lastLivenessTime)
@@ -182,13 +180,13 @@
 func TestUpdateLiveness_AliveStatusUnchanged(t *testing.T) {
 	backend := provisionBackendWithEmbeddedEtcdServer(t)
 	// Enable Liveness Channel and verify initial state is not-alive
-	aliveState := backend.EnableLivenessChannel(context.Background())
+	aliveState := backend.EnableLivenessChannel()
 	assert.NotNil(t, aliveState)
 	assert.Equal(t, false, <-backend.liveness)
 	lastUpdateTime := backend.lastLivenessTime
 
 	// Update with same alive state. Verify no further alive state push
-	backend.updateLiveness(context.Background(), false)
+	backend.updateLiveness(false)
 	assert.Equal(t, 0, len(backend.liveness))
 	assert.Equal(t, lastUpdateTime, backend.lastLivenessTime)
 
@@ -197,7 +195,7 @@
 	backend.lastLivenessTime = time.Now().Add(-tenMinDuration)
 	lastUpdateTime = backend.lastLivenessTime
 
-	backend.updateLiveness(context.Background(), false)
+	backend.updateLiveness(false)
 	assert.Equal(t, 1, len(backend.liveness))
 	assert.Equal(t, false, <-backend.liveness)
 	assert.NotEqual(t, lastUpdateTime, backend.lastLivenessTime)
@@ -225,7 +223,7 @@
 
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			if backend.isErrorIndicatingAliveKvstore(context.Background(), tt.arg) != tt.want {
+			if backend.isErrorIndicatingAliveKvstore(tt.arg) != tt.want {
 				t.Errorf("isErrorIndicatingAliveKvstore failed for %s: expected %t but got %t", tt.name, tt.want, !tt.want)
 			}
 		})
@@ -413,7 +411,7 @@
 	time.Sleep(time.Millisecond * 100)
 	assert.Equal(t, 1, len(eventChan))
 
-	backend.DeleteWatch(context.Background(), "key5", eventChan)
+	backend.DeleteWatch("key5", eventChan)
 }
 
 // Test Create and Delete Watch with prefix for Embedded Etcd Server
@@ -434,5 +432,5 @@
 	time.Sleep(time.Millisecond * 100)
 	assert.Equal(t, 1, len(eventChan))
 
-	backend.DeleteWatch(context.Background(), "key6", eventChan)
+	backend.DeleteWatch("key6", eventChan)
 }