summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJon Loeliger <jdl@netgate.com>2020-11-03 15:49:10 -0500
committerDave Barach <openvpp@barachs.net>2020-11-10 10:58:54 +0000
commit5f7f47ec7ad642c3938376420ef9530176052cd8 (patch)
tree50db45b900d2f315d7edcfe0394e2d350f378f0c /test
parent212ec2af92b148cd3747e6ab424c0080d4a62968 (diff)
classify: fix classify filter trace del cli processing
When a 'del' is used to delete a classify table, only the mask is needed to locate the table. Any match vector is unneeded. The tests failed to notice this, but if the test is run by hand in vppctl, it issues a parse error. Fix the test so that it doesn't supply irrelevant data. Fix the CLI processing to read always complete newline terminated line of input instead. This allows unneeded CLI parameters to be ignored. It also necessitated fixing a trace test which had then erroneously split a single CLI command over multiple lines. While in the area, fix a latent bug on table matching where a test for compatible mask vector sizes were not matching impedance properly (byte vs ux32x4). Type: fix Signed-off-by: Jon Loeliger <jdl@netgate.com> Change-Id: I1177ab1dd417f3d11f30eecbaa2b0fb1015c3ab5
Diffstat (limited to 'test')
-rw-r--r--test/test_pcap.py3
-rw-r--r--test/test_trace_filter.py9
2 files changed, 5 insertions, 7 deletions
diff --git a/test/test_pcap.py b/test/test_pcap.py
index c3c7a662f04..353ad2178b5 100644
--- a/test/test_pcap.py
+++ b/test/test_pcap.py
@@ -67,8 +67,7 @@ class TestPcap(VppTestCase):
"show cla t",
"pa en",
"pcap trace rx tx off",
- "classify filter pcap del mask l3 ip4 src "
- "match l3 ip4 src 11.22.33.44"]
+ "classify filter pcap del mask l3 ip4 src"]
for cmd in cmds:
r = self.vapi.cli_return_response(cmd)
diff --git a/test/test_trace_filter.py b/test/test_trace_filter.py
index cd93c7463f7..a9f28787eda 100644
--- a/test/test_trace_filter.py
+++ b/test/test_trace_filter.py
@@ -71,7 +71,7 @@ class TestTracefilter(VppTestCase):
" incrementing 286\n"
" }\n"
"}\n",
- "classify filter trace mask l3 ip4 src\n"
+ "classify filter trace mask l3 ip4 src"
" match l3 ip4 src 192.168.1.15",
"trace add pg-input 100 filter",
"pa en classifyme"]
@@ -84,8 +84,7 @@ class TestTracefilter(VppTestCase):
# cleanup
self.cli("pa de classifyme")
- self.cli("classify filter trace del mask l3 ip4 src "
- "match l3 ip4 src 192.168.1.15")
+ self.cli("classify filter trace del mask l3 ip4 src")
# install a classify rule, inject traffic and check for hits
def assert_classify(self, mask, match, packets, n=None):
@@ -100,8 +99,8 @@ class TestTracefilter(VppTestCase):
self.assert_hits(n if n is not None else len(packets))
self.cli("clear trace")
self.cli(
- "classify filter trace del mask hex %s match hex %s" %
- (mask, match))
+ "classify filter trace del mask hex %s" %
+ (mask))
def test_encap(self):
""" Packet Tracer Filter Test with encap """