l2: BD ARP termination entry API update
[vpp.git] / test / test_l2bd_arp_term.py
index de84edd..bdf0a80 100644 (file)
@@ -51,6 +51,10 @@ class TestL2bdArpTerm(VppTestCase):
             super(TestL2bdArpTerm, cls).tearDownClass()
             raise
 
+    @classmethod
+    def tearDownClass(cls):
+        super(TestL2bdArpTerm, cls).tearDownClass()
+
     def setUp(self):
         """
         Clear trace and packet infos before running each test.
@@ -63,15 +67,22 @@ class TestL2bdArpTerm(VppTestCase):
         Show various debug prints after each test.
         """
         super(TestL2bdArpTerm, self).tearDown()
-        if not self.vpp_dead:
-            self.logger.info(self.vapi.ppcli("show l2fib verbose"))
+
+    def show_commands_at_teardown(self):
+        self.logger.info(self.vapi.ppcli("show l2fib verbose"))
+        # many tests delete bridge-domain 1 as the last task.  don't output
+        # the details of a non-existent bridge-domain.
+        if self.vapi.l2_fib_table_dump(bd_id=1):
             self.logger.info(self.vapi.ppcli("show bridge-domain 1 detail"))
 
     def add_del_arp_term_hosts(self, entries, bd_id=1, is_add=1, is_ipv6=0):
         for e in entries:
             ip = e.ip4 if is_ipv6 == 0 else e.ip6
-            self.vapi.bd_ip_mac_add_del(bd_id=bd_id, is_add=is_add, ip=ip,
-                                        mac=e.mac)
+            self.vapi.bd_ip_mac_add_del(is_add=is_add,
+                                        entry={
+                                            'bd_id': bd_id,
+                                            'ip': ip,
+                                            'mac': e.mac})
 
     @classmethod
     def mac_list(cls, b6_range):