VOL-2224 Event Filter Mechanism

         This commit contains the inital changes required for the event
         filtering so that when the protos get merged the rw and ro core
         could be built without compilation errors

         Note: This patchset and the patchset for voltha-protos needs to be merged
               as close to as possible otherwise there will be compilation errors

Change-Id: Id092fa19a0b302a33176a82e41b92a36ea8ede29
diff --git a/tests/afrouter/suites/test3/test3.go b/tests/afrouter/suites/test3/test3.go
index f0a65c7..79ea6c1 100644
--- a/tests/afrouter/suites/test3/test3.go
+++ b/tests/afrouter/suites/test3/test3.go
@@ -200,16 +200,16 @@
 		Expect: `{Id:\"group-ABC123XYZ\", LogicalDevices: []*voltha.LogicalDevice{&voltha.LogicalDevice{Id:\"LDevId\", DatapathId:64, RootDeviceId:\"Root\"}}, Devices: []*voltha.Device{&voltha.Device{Id:\"ABC123XYZ\", Type:\"SomeDeviceType\", Root:false, ParentId:\"ZYX321CBA\"},&voltha.Device{Id:\"ZYX321CBA\", Type:\"SomeDeviceType\", Root:true, ParentId:\"ROOT\"}}}`,
 	},
 	{
-		Name:   "Test ListAlarmFilters",
-		Method: "ListAlarmFilters", // rpc ListAlarmFilters(google.protobuf.Empty) returns(AlarmFilters)
+		Name:   "Test ListEventFilters",
+		Method: "ListEventFilters", // rpc ListEventFilters(google.protobuf.Empty) returns(EventFilters)
 		Param:  `{}`,
-		Expect: `{Filters:[]*voltha.AlarmFilter{&voltha.AlarmFilter{Id:\"ABC123XYZ\", Rules: []*voltha.AlarmFilterRule{&voltha.AlarmFilterRule{Value:\"Rule Value\"}}}}}`,
+		Expect: `{Filters:[]*voltha.EventFilter{&voltha.EventFilter{Id:\"ABC123XYZ\", DeviceId: \"Device123\", Enable: \"True\", EventType: \"DeviceEvent\", Rules: []*voltha.EventFilterRule{&voltha.EventFilterRule{Value:\"Rule Value\"}}}}}`,
 	},
 	{
-		Name:   "Test GetAlarmFilter",
-		Method: "GetAlarmFilter", // rpc GetAlarmFilter(ID) returns(AlarmFilter)
+		Name:   "Test GetEventFilter",
+		Method: "GetEventFilter", // rpc GetEventFilter(ID) returns(EventFilters)
 		Param:  `{Id:\"ABC123XYZ\"}`,
-		Expect: `{Id:\"ABC123XYZ\", Rules: []*voltha.AlarmFilterRule{&voltha.AlarmFilterRule{Value:\"Rule Value\"}}}`,
+		Expect: `{Filters:[]*voltha.EventFilter{&voltha.EventFilter{Id:\"ABC123XYZ\", DeviceId: \"Device123\", Enable: \"True\", EventType: \"DeviceEvent\", Rules: []*voltha.EventFilterRule{&voltha.EventFilterRule{Value:\"Rule Value\"}}}}}`,
 	},
 	{
 		Name:   "Test GetImages",
@@ -315,20 +315,21 @@
 		Expect: `{}`,
 	},
 	{
-		Name:   "Test CreateAlarmFilter",
-		Method: "CreateAlarmFilter", // rpc CreateAlarmFilter(AlarmFilter) returns(AlarmFilter)
-		Param:  `{Id:\"abc123xyz\", Rules:[]*voltha.AlarmFilterRule{&voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_type, Value:\"Type man, it's the type!\"}, &voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_category, Value:\"Category yeah!\"}}}`,
-		Expect: `{Id:\"abc123xyz\", Rules: []*voltha.AlarmFilterRule{&voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_type, Value:\"Type man, it's the type!\"}, &voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_category, Value:\"Category yeah!\"}}}`,
+		Name:   "Test CreateEventFilter",
+		Method: "CreateEventFilter", // rpc CreateEventFilter(EventFilter) returns(EventFilter)
+		//		Param:  `{Id:\"abc123xyz\", Rules:[]*voltha.EventFilterRule{&voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_type, Value:\"Type man, it's the type!\"}, &voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_category, Value:\"Category yeah!\"}}}`,
+		Param:  `{Id:\"abc123xyz\", DeviceId: \"Device123\", Enable: True, EventType: \"device_event\", Rules:[]*voltha.EventFilterRule{&voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_category, Value:\"Equipment\"}, &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_sub_category, Value:\"ONU\"}, &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_device_event_type, Value:\"dying_gasp_event\"}}}`,
+		Expect: `{Id:\"abc123xyz\", DeviceId: \"Device123\", Enable: True, EventType: \"device_event\", Rules:[]*voltha.EventFilterRule{&voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_category, Value:\"Equipment\"},     &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_sub_category, Value:\"ONU\"}, &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_device_event_type, Value:\"dying_gasp_event\"}}}`,
 	},
 	{
-		Name:   "Test UpdateAlarmFilter",
-		Method: "UpdateAlarmFilter", // rpc UpdateAlarmFilter(AlarmFilter) returns(AlarmFilter)
-		Param:  `{Id:\"ABC321XYZ\", Rules:[]*voltha.AlarmFilterRule{&voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_type, Value:\"Type man, it's the type!\"}, &voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_category, Value:\"Category yeah!\"}}}`,
-		Expect: `{Id:\"ABC321XYZ\", Rules: []*voltha.AlarmFilterRule{&voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_type, Value:\"Type man, it's the type!\"}, &voltha.AlarmFilterRule{Key:voltha.AlarmFilterRuleKey_category, Value:\"Category yeah!\"}}}`,
+		Name:   "Test UpdateEventFilter",
+		Method: "UpdateEventFilter", // rpc UpdateEventFilter(EventFilter) returns(EventFilter)
+		Param:  `{Id:\"abc123xyz\", DeviceId: \"Device123\", Enable: True, EventType: \"device_event\", Rules:[]*voltha.EventFilterRule{&voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_category, Value:\"Equipment\"}, &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_sub_category, Value:\"ONU\"}, &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_device_event_type, Value:\"dying_gasp_event\"}}}`,
+		Expect: `{Id:\"abc123xyz\", DeviceId: \"Device123\", Enable: True, EventType: \"device_event\", Rules:[]*voltha.EventFilterRule{&voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_category, Value:\"Equipment\"}, &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_sub_category, Value:\"ONU\"}, &voltha.EventFilterRule{Key:voltha.EventFilterRuleKey_device_event_type, Value:\"dying_gasp_event\"}}}`,
 	},
 	{
-		Name:   "Test DeleteAlarmFilter",
-		Method: "DeleteAlarmFilter", // rpc DeleteAlarmFilter(ID) returns(google.protobuf.Empty)
+		Name:   "Test DeleteEventFilter",
+		Method: "DeleteEventFilter", // rpc DeleteEventFilter(EventFilter) returns(google.protobuf.Empty)
 		Param:  `{Id:\"acb123xyz\"}`,
 		Expect: `{}`,
 	},