tests: tag the tests that do not work with multi-worker configuration
[vpp.git] / test / test_ip4.py
index c99ab63..f0b4394 100644 (file)
@@ -11,6 +11,7 @@ from scapy.layers.l2 import Ether, Dot1Q, ARP
 from scapy.packet import Raw
 from six import moves
 
+from framework import tag_fixme_vpp_workers
 from framework import VppTestCase, VppTestRunner
 from util import ppp
 from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpMRoute, \
@@ -1533,6 +1534,14 @@ class TestIPPunt(IPPuntSetup, VppTestCase):
         # but not equal to the number sent, since some were policed
         #
         rx = self.pg1._get_capture(1)
+
+        stats = policer.get_stats()
+
+        # Single rate policer - expect conform, violate but no exceed
+        self.assertGreater(stats['conform_packets'], 0)
+        self.assertEqual(stats['exceed_packets'], 0)
+        self.assertGreater(stats['violate_packets'], 0)
+
         self.assertGreater(len(rx), 0)
         self.assertLess(len(rx), len(pkts))
 
@@ -1636,6 +1645,24 @@ class TestIPPuntHandoff(IPPuntSetup, VppTestCase):
             if worker == 0:
                 self.logger.debug(self.vapi.cli("show trace max 100"))
 
+        # Combined stats, all threads
+        stats = policer.get_stats()
+
+        # Single rate policer - expect conform, violate but no exceed
+        self.assertGreater(stats['conform_packets'], 0)
+        self.assertEqual(stats['exceed_packets'], 0)
+        self.assertGreater(stats['violate_packets'], 0)
+
+        # Worker 0, should have done all the policing
+        stats0 = policer.get_stats(worker=0)
+        self.assertEqual(stats, stats0)
+
+        # Worker 1, should have handed everything off
+        stats1 = policer.get_stats(worker=1)
+        self.assertEqual(stats1['conform_packets'], 0)
+        self.assertEqual(stats1['exceed_packets'], 0)
+        self.assertEqual(stats1['violate_packets'], 0)
+
         #
         # Clean up
         #
@@ -2069,6 +2096,7 @@ class TestIPLPM(VppTestCase):
         rx = self.send_and_expect(self.pg0, p_24 * NUM_PKTS, self.pg1)
 
 
+@tag_fixme_vpp_workers
 class TestIPv4Frag(VppTestCase):
     """ IPv4 fragmentation """