summaryrefslogtreecommitdiffstats
path: root/test/vpp_l2.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-12 02:34:07 -0700
committerNeale Ranns <nranns@cisco.com>2019-03-12 16:50:23 +0000
commit36abbf10045ba81733410f50a3f5a9463f7137d1 (patch)
tree3adcabaa69bcbe4cbe801c45866a1f4c46c12443 /test/vpp_l2.py
parent7bd343509fa30f9713b6efa9a4acb83e0ab86cfb (diff)
GBP: L3 out fixes
Change-Id: I0562d597fd45c7ddcb6db42cf17d3ffb569eb140 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/vpp_l2.py')
-rw-r--r--test/vpp_l2.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/vpp_l2.py b/test/vpp_l2.py
index 45b7d69dd01..dc73e4238f3 100644
--- a/test/vpp_l2.py
+++ b/test/vpp_l2.py
@@ -208,3 +208,32 @@ class VppL2FibEntry(VppObject):
def object_id(self):
return "L2-Fib-Entry-%s-%s-%s" % (self.bd, self.mac, self.itf)
+
+
+class VppL2Vtr(VppObject):
+
+ def __init__(self, test, itf, op):
+ self._test = test
+ self.itf = itf
+ self.op = op
+
+ def add_vpp_config(self):
+ self.itf.set_vtr(self.op)
+ self._test.registry.register(self, self._test.logger)
+
+ def remove_vpp_config(self):
+ self.itf.set_vtr(L2_VTR_OP.L2_DISABLED)
+
+ def query_vpp_config(self):
+ ds = self._test.vapi.sw_interface_dump()
+ d = self.itf.get_interface_config_from_dump(ds)
+
+ if d is not None:
+ return (d.vtr_op == self.op)
+ return False
+
+ def __str__(self):
+ return self.object_id()
+
+ def object_id(self):
+ return "L2-vtr-%s-%d" % (str(self.itf), self.op)