VOL-1577 - General cleanup (gofmt, go vet, go test, dep check)
Change-Id: I536b2746b8bd266f3e75aeccc65bfe7468f1b44a
diff --git a/tests/kafka/kafka_client_test.go b/tests/kafka/kafka_client_test.go
index b4fc0cf..f6eadff 100644
--- a/tests/kafka/kafka_client_test.go
+++ b/tests/kafka/kafka_client_test.go
@@ -1,3 +1,5 @@
+// +build integration
+
/*
* Copyright 2018-present Open Networking Foundation
diff --git a/tests/kafka/kafka_inter_container_messaging_test.go b/tests/kafka/kafka_inter_container_messaging_test.go
index d6a8e8b..6a6dbc2 100644
--- a/tests/kafka/kafka_inter_container_messaging_test.go
+++ b/tests/kafka/kafka_inter_container_messaging_test.go
@@ -1,3 +1,5 @@
+// +build integration
+
/*
* Copyright 2018-present Open Networking Foundation
@@ -21,9 +23,9 @@
"github.com/google/uuid"
"github.com/opencord/voltha-go/common/log"
kk "github.com/opencord/voltha-go/kafka"
+ rhp "github.com/opencord/voltha-go/rw_core/core"
ic "github.com/opencord/voltha-protos/go/inter_container"
"github.com/opencord/voltha-protos/go/voltha"
- rhp "github.com/opencord/voltha-go/rw_core/core"
"github.com/stretchr/testify/assert"
"os"
"testing"
@@ -34,6 +36,10 @@
Prerequite: Start the kafka/zookeeper containers.
*/
+const (
+ TEST_RPC_KEY = ""
+)
+
var coreKafkaProxy *kk.InterContainerProxy
var adapterKafkaProxy *kk.InterContainerProxy
var kafkaPartitionClient kk.Client
@@ -170,7 +176,7 @@
rpc := "IncorrectAPI"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, false)
@@ -193,7 +199,7 @@
rpc := "GetDevice"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, false)
@@ -220,7 +226,7 @@
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(ctx, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(ctx, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, true)
@@ -245,7 +251,7 @@
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(ctx, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(ctx, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, false)
@@ -268,7 +274,7 @@
topic := kk.Topic{Name: "Core"}
expectedResponse := &voltha.Device{Id: trnsId}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, true)
@@ -291,7 +297,7 @@
topic := kk.Topic{Name: "Core"}
expectedResponse := &voltha.Device{Id: trnsId}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, true)
@@ -318,7 +324,7 @@
rpc := "GetPorts"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, true)
@@ -341,7 +347,7 @@
rpc := "GetPorts"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, false)
@@ -385,7 +391,7 @@
rpc := "ChildDeviceDetected"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, true)
@@ -424,7 +430,7 @@
rpc := "ChildDeviceDetected"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, false, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, false, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, true)
@@ -453,7 +459,7 @@
rpc := "ChildDeviceDetected"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, false)
@@ -487,7 +493,7 @@
rpc := "DeviceStateUpdate"
topic := kk.Topic{Name: "Core"}
start := time.Now()
- status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, args...)
+ status, result := adapterKafkaProxy.InvokeRPC(nil, rpc, &topic, &topic, true, TEST_RPC_KEY, args...)
elapsed := time.Since(start)
log.Infow("Result", log.Fields{"status": status, "result": result, "time": elapsed})
assert.Equal(t, status, true)