diff options
author | João Valverde <j@v6e.pt> | 2022-12-29 06:04:00 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-01-07 21:15:25 +0000 |
commit | 1861679e8132a26ff1eb891e349856fdcea1f8be (patch) | |
tree | d1eaaa8be2265158a9cc276ddaefecff122a0f70 /test | |
parent | 7641ba7416cdb0232ecef7c5aa3d39a711d1766c (diff) |
dfilter: Optimize some scanner patterns
Cleanup flex code. Optimize some patterns to avoid lookups
for field matches for values that are not legal field names.
Improve warning and add some comments.
Diffstat (limited to 'test')
-rw-r--r-- | test/suite_dfilter/group_syntax.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/suite_dfilter/group_syntax.py b/test/suite_dfilter/group_syntax.py index a2494ae84f..77762fb8ea 100644 --- a/test/suite_dfilter/group_syntax.py +++ b/test/suite_dfilter/group_syntax.py @@ -193,11 +193,26 @@ class case_equality(unittest.TestCase): dfilter = 'frame[37] == fc:' checkDFilterCount(dfilter, 1) - def test_rhs_literal_bias_4(self, checkDFilterCount): + def test_rhs_bias_4(self, checkDFilterCount): # Protocol "Fibre Channel" on the RHS dfilter = 'frame[37] == .fc' checkDFilterCount(dfilter, 0) + def test_rhs_bias_5(self, checkDFilterSucceed): + # Protocol "Fibre Channel" on the RHS (with warning) + dfilter = 'frame contains fc' + checkDFilterSucceed(dfilter, 'Interpreting "fc" as Fibre Channel') + + def test_rhs_bias_6(self, checkDFilterSucceed): + # Protocol "Fibre Channel" on the RHS (without warning) + dfilter = 'frame contains .fc' + checkDFilterSucceed(dfilter) + + def test_rhs_bias_7(self, checkDFilterSucceed): + # Byte 0xFC on the RHS + dfilter = 'frame contains fc:' + checkDFilterSucceed(dfilter) + @fixtures.uses_fixtures class case_bitwise(unittest.TestCase): trace_file = "http.pcap" |