From 008dbe109ce2714be69ffb6549a0c0198a07f7d0 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Fri, 7 Sep 2018 09:32:36 -0700 Subject: Route counters in the stats segment route ADD API changed to return the stats segment index to use to read the counters Change-Id: I2ef41e01eaa2f9cfaa49d9c88968897793825925 Signed-off-by: Neale Ranns --- test/test_mpls.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/test_mpls.py') diff --git a/test/test_mpls.py b/test/test_mpls.py index d943f8281e9..1a4dad18e30 100644 --- a/test/test_mpls.py +++ b/test/test_mpls.py @@ -389,6 +389,8 @@ class TestMPLS(VppTestCase): self.verify_capture_labelled(self.pg0, rx, tx, [VppMplsLabel(33, ttl=31, exp=1)]) + self.assertEqual(route_32_eos.get_stats_to()['packets'], 257) + # # A simple MPLS xconnect - non-eos label in label out # @@ -409,6 +411,7 @@ class TestMPLS(VppTestCase): self.verify_capture_labelled(self.pg0, rx, tx, [VppMplsLabel(33, ttl=20, exp=7), VppMplsLabel(99)]) + self.assertEqual(route_32_neos.get_stats_to()['packets'], 257) # # A simple MPLS xconnect - non-eos label in label out, uniform mode @@ -575,6 +578,9 @@ class TestMPLS(VppTestCase): VppMplsLabel(44), VppMplsLabel(45, ttl=2)]) + self.assertEqual(route_34_eos.get_stats_to()['packets'], 257) + self.assertEqual(route_32_neos.get_stats_via()['packets'], 257) + # # A recursive EOS x-connect, which resolves through another x-connect # in uniform mode @@ -635,6 +641,7 @@ class TestMPLS(VppTestCase): VppMplsLabel(44), VppMplsLabel(46), VppMplsLabel(55)]) + self.assertEqual(ip_10_0_0_1.get_stats_to()['packets'], 257) ip_10_0_0_1.remove_vpp_config() route_34_neos.remove_vpp_config() @@ -782,6 +789,8 @@ class TestMPLS(VppTestCase): [VppMplsLabel(32), VppMplsLabel(44)]) + self.assertEqual(route_11_0_0_1.get_stats_to()['packets'], 257) + # # add a recursive path, with 2 labels, via the 3 label route # @@ -805,6 +814,18 @@ class TestMPLS(VppTestCase): VppMplsLabel(44), VppMplsLabel(45)]) + self.assertEqual(route_11_0_0_2.get_stats_to()['packets'], 257) + + rx = self.send_and_expect(self.pg0, tx, self.pg0) + self.verify_capture_labelled_ip4(self.pg0, rx, tx, + [VppMplsLabel(32), + VppMplsLabel(33), + VppMplsLabel(34), + VppMplsLabel(44), + VppMplsLabel(45)]) + + self.assertEqual(route_11_0_0_2.get_stats_to()['packets'], 514) + # # cleanup # -- cgit 1.2.3-korg