aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2022-08-09 03:03:29 +0000
committerBeno�t Ganne <bganne@cisco.com>2022-08-11 06:54:16 +0000
commite22a7041626cf1ebee7534d84068d48e8671a6ab (patch)
treedc3a7f46c3a4aef4c3af20229d3df18fb5465f8a /test
parent93688d7341ada44755dc0432de3e3dbaaa8aa111 (diff)
ip: Use .api declared error counters
Type: improvement Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I822ead1495edb96ee62e53dc5920aa6c565e3621
Diffstat (limited to 'test')
-rw-r--r--test/test_gre.py4
-rw-r--r--test/test_ip4.py8
-rw-r--r--test/test_ip_mcast.py8
-rw-r--r--test/test_mpls.py4
-rw-r--r--test/test_reassembly.py12
5 files changed, 11 insertions, 25 deletions
diff --git a/test/test_gre.py b/test/test_gre.py
index a79819ed73c..cfba5594641 100644
--- a/test/test_gre.py
+++ b/test/test_gre.py
@@ -58,7 +58,7 @@ class TestGREInputNodes(VppTestCase):
self.pg0.add_stream(pkt)
self.pg_start()
# no tunnel created, gre-input not registered
- err = self.statistics.get_counter("/err/ip4-local/unknown ip protocol")[0]
+ err = self.statistics.get_counter("/err/ip4-local/unknown_protocol")[0]
self.assertEqual(err, 1)
err_count = err
@@ -69,7 +69,7 @@ class TestGREInputNodes(VppTestCase):
self.pg0.add_stream(pkt)
self.pg_start()
# tunnel created, gre-input registered
- err = self.statistics.get_counter("/err/ip4-local/unknown ip protocol")[0]
+ err = self.statistics.get_counter("/err/ip4-local/unknown_protocol")[0]
# expect no new errors
self.assertEqual(err, err_count)
diff --git a/test/test_ip4.py b/test/test_ip4.py
index 9079e54366a..736d8f7bc4c 100644
--- a/test/test_ip4.py
+++ b/test/test_ip4.py
@@ -1793,9 +1793,7 @@ class TestIPPunt(IPPuntSetup, VppTestCase):
self.send_and_assert_no_replies(self.pg0, [pkts[0]])
self.send_and_assert_no_replies(self.pg0, pkts)
- self.assert_error_counter_equal(
- "/err/ip4-local/ip4 source lookup miss", len(pkts) + 1
- )
+ self.assert_error_counter_equal("/err/ip4-local/src_lookup_miss", len(pkts) + 1)
# using the same source in different tables, should reject
# for the table that the source is not present in
@@ -1855,9 +1853,7 @@ class TestIPPunt(IPPuntSetup, VppTestCase):
self.send_and_assert_no_replies(self.pg0, [pkts[0]])
self.send_and_assert_no_replies(self.pg0, pkts)
- self.assert_error_counter_equal(
- "/err/ip6-input/ip6 source lookup miss", len(pkts) + 1
- )
+ self.assert_error_counter_equal("/err/ip6-input/src_lookup_miss", len(pkts) + 1)
# using the same source in different tables, should reject
# for the table that the source is not present in
diff --git a/test/test_ip_mcast.py b/test/test_ip_mcast.py
index c3ac16c6d85..b060e97ff9d 100644
--- a/test/test_ip_mcast.py
+++ b/test/test_ip_mcast.py
@@ -222,9 +222,7 @@ class TestIPMcast(VppTestCase):
self.pg0.assert_nothing_captured(
remark="IP multicast packets forwarded on default route"
)
- count = self.statistics.get_err_counter(
- "/err/ip4-input/Multicast RPF check failed"
- )
+ count = self.statistics.get_err_counter("/err/ip4-input/rpf_failure")
self.assertEqual(count, len(tx))
#
@@ -577,9 +575,7 @@ class TestIPMcast(VppTestCase):
self.vapi.cli("clear trace")
tx = self.create_stream_ip6(self.pg1, "2002::1", "ff01:2::255")
self.send_and_assert_no_replies(self.pg1, tx, "RPF miss")
- count = self.statistics.get_err_counter(
- "/err/ip6-input/Multicast RPF check failed"
- )
+ count = self.statistics.get_err_counter("/err/ip6-input/rpf_failure")
self.assertEqual(count, 2 * len(tx))
#
diff --git a/test/test_mpls.py b/test/test_mpls.py
index 6e01a03aea1..846179765dc 100644
--- a/test/test_mpls.py
+++ b/test/test_mpls.py
@@ -1148,9 +1148,7 @@ class TestMPLS(VppTestCase):
self.assertEqual(rx[ICMP].nexthopmtu, 9000 - 4)
self.assertEqual(
- self.statistics.get_err_counter(
- "/err/mpls-frag/can't fragment this packet"
- ),
+ self.statistics.get_err_counter("/err/mpls-frag/dont_fragment_set"),
len(tx),
)
#
diff --git a/test/test_reassembly.py b/test/test_reassembly.py
index cebe5837763..cef94f3dda6 100644
--- a/test/test_reassembly.py
+++ b/test/test_reassembly.py
@@ -235,9 +235,7 @@ class TestIPv4Reassembly(VppTestCase):
def test_long_fragment_chain(self):
"""long fragment chain"""
- error_cnt_str = (
- "/err/ip4-full-reassembly-feature/fragment chain too long (drop)"
- )
+ error_cnt_str = "/err/ip4-full-reassembly-feature/reass_fragment_chain_too_long"
error_cnt = self.statistics.get_err_counter(error_cnt_str)
@@ -286,7 +284,7 @@ Ethernet-Payload.IPv4-Packet.IPv4-Header.Fragment-Offset; Test-case: 5737"""
)
valid_fragments = fragment_rfc791(p, 400)
- counter = "/err/ip4-full-reassembly-feature/malformed packets"
+ counter = "/err/ip4-full-reassembly-feature/reass_malformed_packet"
error_counter = self.statistics.get_err_counter(counter)
self.pg_enable_capture()
self.src_if.add_stream([malformed_packet] + valid_fragments)
@@ -394,7 +392,7 @@ Ethernet-Payload.IPv4-Packet.IPv4-Header.Fragment-Offset; Test-case: 5737"""
# TODO remove above, uncomment below once clearing of counters
# is supported
# self.assert_packet_counter_equal(
- # "/err/ip4-full-reassembly-feature/malformed packets", 1)
+ # "/err/ip4-full-reassembly-feature/reass_malformed_packet", 1)
def test_random(self):
"""random order reassembly"""
@@ -1394,9 +1392,7 @@ class TestIPv6Reassembly(VppTestCase):
def test_long_fragment_chain(self):
"""long fragment chain"""
- error_cnt_str = (
- "/err/ip6-full-reassembly-feature/fragment chain too long (drop)"
- )
+ error_cnt_str = "/err/ip6-full-reassembly-feature/reass_fragment_chain_too_long"
error_cnt = self.statistics.get_err_counter(error_cnt_str)