misc: Fix python scripts shebang line
[vpp.git] / test / test_ip4_irb.py
index 0894515..20181b0 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """IRB Test Case HLD:
 
 **config**
@@ -89,18 +89,23 @@ class TestIpIrb(VppTestCase):
         cls.pg0.remote_hosts = cls.bvi0.remote_hosts[:half]
         cls.pg1.remote_hosts = cls.bvi0.remote_hosts[half:]
 
+    @classmethod
+    def tearDownClass(cls):
+        super(TestIpIrb, cls).tearDownClass()
+
     def tearDown(self):
         """Run standard test teardown and log ``show l2patch``,
         ``show l2fib verbose``,``show bridge-domain <bd_id> detail``,
         ``show ip arp``.
         """
         super(TestIpIrb, self).tearDown()
-        if not self.vpp_dead:
-            self.logger.info(self.vapi.cli("show l2patch"))
-            self.logger.info(self.vapi.cli("show l2fib verbose"))
-            self.logger.info(self.vapi.cli("show bridge-domain %s detail" %
-                                           self.bd_id))
-            self.logger.info(self.vapi.cli("show ip arp"))
+
+    def show_commands_at_teardown(self):
+        self.logger.info(self.vapi.cli("show l2patch"))
+        self.logger.info(self.vapi.cli("show l2fib verbose"))
+        self.logger.info(self.vapi.cli("show bridge-domain %s detail" %
+                                       self.bd_id))
+        self.logger.info(self.vapi.cli("show ip arp"))
 
     def create_stream(self, src_ip_if, dst_ip_if, packet_sizes):
         pkts = []