aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-03-13 21:53:18 -0400
committerDave Barach <openvpp@barachs.net>2018-03-14 12:07:48 +0000
commite23c99ec0061991cf3904122979ac755fe1b78ca (patch)
tree9ffa879cbdc7721138e5c0833605c7a060bebf52 /test
parent04def7418b649a94e32149ee924a3743358b5c84 (diff)
Improve l2_macs_events API to provide MAC move information
Change mac_entry layout in l2_macs_event API message so the MAC entry can be either add, delete or move where the sw_if_index of an existing MAC entry changed. Also added a 8-bit flags field in mac_entry for any future expansion. Change-Id: I3bf9e1cf2556f2938202025a5d0772c2ce2fc99f Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_l2_fib.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test_l2_fib.py b/test/test_l2_fib.py
index ba2f787bdd9..abab0f1088b 100644
--- a/test/test_l2_fib.py
+++ b/test/test_l2_fib.py
@@ -70,6 +70,11 @@ from scapy.layers.inet import IP, UDP
from framework import VppTestCase, VppTestRunner
from util import Host, ppp
+# from src/vnet/l2/l2_fib.h
+MAC_EVENT_ACTION_ADD = 0
+MAC_EVENT_ACTION_DELETE = 1
+MAC_EVENT_ACTION_MOVE = 2
+
class TestL2fib(VppTestCase):
""" L2 FIB Test Case """
@@ -483,7 +488,7 @@ class TestL2fib(VppTestCase):
evs = self.vapi.collect_events()
learned_macs = {
e.mac[i].mac_addr for e in evs for i in range(e.n_macs)
- if not e.mac[i].is_del}
+ if e.mac[i].action == MAC_EVENT_ACTION_ADD}
macs = {h.bin_mac for swif in self.bd_ifs(bd1)
for h in hosts[self.pg_interfaces[swif].sw_if_index]}
self.vapi.want_macs_learn_events(enable_disable=0)
@@ -507,7 +512,7 @@ class TestL2fib(VppTestCase):
self.assertGreater(len(evs), 0)
learned_macs = {
e.mac[i].mac_addr for e in evs for i in range(e.n_macs)
- if not e.mac[i].is_del}
+ if e.mac[i].action == MAC_EVENT_ACTION_ADD}
macs = {h.bin_mac for swif in self.bd_ifs(bd1)
for h in hosts[self.pg_interfaces[swif].sw_if_index]}