[VOL-3662] Supporting PPPoE trap rules on voltha core

Signed-off-by: Marcos Aurelio Carrero (Furukawa) <mcarrero@furukawalatam.com>
Change-Id: I9117c1d97412a2173a7ce232032cbd366a83cab9
diff --git a/rw_core/core/api/grpc_nbi_handler_test.go b/rw_core/core/api/grpc_nbi_handler_test.go
index 2891c36..7436083 100755
--- a/rw_core/core/api/grpc_nbi_handler_test.go
+++ b/rw_core/core/api/grpc_nbi_handler_test.go
@@ -50,6 +50,8 @@
 	"google.golang.org/grpc/status"
 )
 
+const numTrapOnNNIFlows = 4
+
 type NBTest struct {
 	etcdServer        *mock_etcd.EtcdServer
 	deviceMgr         *device.Manager
@@ -1119,7 +1121,7 @@
 }
 
 func (nb *NBTest) verifyLogicalDeviceFlowCount(t *testing.T, nbi *NBIHandler, numNNIPorts int, numUNIPorts int, flowAddFail bool) {
-	expectedNumFlows := numNNIPorts*3 + numNNIPorts*numUNIPorts
+	expectedNumFlows := numNNIPorts*numTrapOnNNIFlows + numNNIPorts*numUNIPorts
 	if flowAddFail {
 		expectedNumFlows = 0
 	}
@@ -1198,6 +1200,20 @@
 	_, err = nbi.UpdateLogicalDeviceFlowTable(getContext(), &flowIPV6)
 	assert.Nil(t, err)
 
+	fa = &flows.FlowArgs{
+		KV: flows.OfpFlowModArgs{"priority": 10000, "buffer_id": maxInt32, "out_port": maxInt32, "out_group": maxInt32, "flags": 1},
+		MatchFields: []*ofp.OfpOxmOfbField{
+			flows.InPort(nniPort),
+			flows.EthType(34915),
+		},
+		Actions: []*ofp.OfpAction{
+			flows.Output(controllerPortMask),
+		},
+	}
+	flowPPPoEP := ofp.FlowTableUpdate{FlowMod: makeSimpleFlowMod(fa), Id: logicalDeviceID}
+	_, err = nbi.UpdateLogicalDeviceFlowTable(getContext(), &flowPPPoEP)
+	assert.Nil(t, err)
+
 	return len(nniPorts), len(uniPorts)
 }
 
@@ -1330,7 +1346,7 @@
 	nb.verifyLogicalDeviceFlowCount(t, nbi, numNNIPorts, numUNIPorts, flowAddFail)
 
 	// Wait until all flows have been sent to the OLT adapters (or all failed)
-	expectedFlowCount := (numNNIPorts * 3) + numNNIPorts*numUNIPorts
+	expectedFlowCount := (numNNIPorts * numTrapOnNNIFlows) + numNNIPorts*numUNIPorts
 	if flowAddFail {
 		expectedFlowCount = 0
 	}