VOL-3521 : scale: intermittent issue - voltha complains that different meter is in use for subscriber
- Process incoming flows on a per ONU basis using channels per ONU
Change-Id: I0f375d90d786a0135bb51ce18036e5297dc7297b
diff --git a/pkg/mocks/mockKVClient.go b/pkg/mocks/mockKVClient.go
index a034f87..662e236 100644
--- a/pkg/mocks/mockKVClient.go
+++ b/pkg/mocks/mockKVClient.go
@@ -54,6 +54,8 @@
FlowGroupCached = "flow_groups_cached"
//OnuPacketIn to extract gem port from packet-in
OnuPacketIn = "onu_packetin"
+ // OnuGemInfoPath has path on the kvstore to store OnuGemInfo info per PON interface
+ OnuGemInfoPath = "onu_gem_info"
)
// MockKVClient mocks the AdapterProxy interface.
@@ -71,6 +73,7 @@
}
// Get mock function implementation for KVClient
+// nolint: gocyclo
func (kvclient *MockKVClient) Get(ctx context.Context, key string) (*kvstore.KVPair, error) {
logger.Debugw(ctx, "Get of MockKVClient called", log.Fields{"key": key})
if key != "" {
@@ -114,7 +117,8 @@
return nil, errors.New("invalid meter")
}
if strings.Contains(key, TpIDPathSuffix) {
- str, _ := json.Marshal(64)
+ data := []uint32{64}
+ str, _ := json.Marshal(data)
return kvstore.NewKVPair(key, str, "mock", 3000, 1), nil
}
if strings.Contains(key, FlowIDpool) {
@@ -152,12 +156,14 @@
}
if strings.Contains(key, GemportIDs) {
logger.Debug(ctx, "Error Error Error Key:", GemportIDs)
- str, _ := json.Marshal(1)
+ data := []uint32{1}
+ str, _ := json.Marshal(data)
return kvstore.NewKVPair(key, str, "mock", 3000, 1), nil
}
if strings.Contains(key, AllocIDs) {
logger.Debug(ctx, "Error Error Error Key:", AllocIDs)
- str, _ := json.Marshal(1)
+ data := []uint32{1}
+ str, _ := json.Marshal(data)
return kvstore.NewKVPair(key, str, "mock", 3000, 1), nil
}
if strings.Contains(key, FlowGroup) || strings.Contains(key, FlowGroupCached) {
@@ -169,10 +175,14 @@
str, _ := json.Marshal(&groupInfo)
return kvstore.NewKVPair(key, str, "mock", 3000, 1), nil
}
-
if strings.Contains(key, OnuPacketIn) {
return getPacketInGemPort(key)
}
+ if strings.Contains(key, OnuGemInfoPath) {
+ var data []resourcemanager.OnuGemInfo
+ str, _ := json.Marshal(data)
+ return kvstore.NewKVPair(key, str, "mock", 3000, 1), nil
+ }
maps := make(map[string]*kvstore.KVPair)
maps[key] = &kvstore.KVPair{Key: key}
@@ -222,7 +232,6 @@
// Put mock function implementation for KVClient
func (kvclient *MockKVClient) Put(ctx context.Context, key string, value interface{}) error {
if key != "" {
-
return nil
}
return errors.New("key didn't find")