diff options
author | João Valverde <j@v6e.pt> | 2023-11-22 21:37:57 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-11-23 12:31:38 +0000 |
commit | 1506126169f894084319e4d2a5c5466ee8c3f041 (patch) | |
tree | 7301de60f93f82d7eac372ab39e42b8109c12110 /test/suite_dfilter | |
parent | 2590f82a8171ae84612757b8879cea37067f238b (diff) |
dfilter: Fix diameter.3GPP-* filters
Manual revert of commit 0e82c6b4b8ed18ef1878446dd26d6345be2d2c2b.
Fixes #19493.
Diffstat (limited to 'test/suite_dfilter')
-rw-r--r-- | test/suite_dfilter/group_syntax.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/test/suite_dfilter/group_syntax.py b/test/suite_dfilter/group_syntax.py index 405e0b0046..d8f5c2a2ee 100644 --- a/test/suite_dfilter/group_syntax.py +++ b/test/suite_dfilter/group_syntax.py @@ -28,6 +28,11 @@ class TestDfilterSyntax: dfilter = "_ws.expert" checkDFilterCount(dfilter, 1) + def test_exists_5(self, checkDFilterSucceed): + # Protocol field name with leading digit and minus + dfilter = "diameter.3GPP-Reporting-Reason" + checkDFilterSucceed(dfilter) + def test_commute_1(self, checkDFilterCount): dfilter = "ip.proto == 6" checkDFilterCount(dfilter, 1) @@ -325,18 +330,22 @@ class TestDfilterArithmetic: checkDFilterCount(dfilter, 2) def test_sub_3(self, checkDFilterCount): - dfilter = "udp.dstport == 68-1" - checkDFilterCount(dfilter, 2) - - def test_sub_4(self, checkDFilterCount): dfilter = "udp.length == ip.len - 20" checkDFilterCount(dfilter, 4) - def test_sub_5(self, checkDFilterCount): - # Make sure 68-67 is parsed as subtraction - # and not bytes separated by hyphen XX-XX-XX + def test_sub_no_space_1(self, checkDFilterFail): + # Minus operator requires whitespace preceding it. + error = '"68-1" cannot be converted to Unsigned integer' + dfilter = "udp.dstport == 68-1" + checkDFilterFail(dfilter, error) + + def test_sub_no_space_2(self, checkDFilterFail): + # Different case, 68-67 should not be parsed + # as bytes separated by hyphen XX-XX-XX + # Minus operator still requires whitespace preceding it. + error = '"68-67" cannot be converted to Unsigned integer' dfilter = "frame.number == 68-67" - checkDFilterCount(dfilter, 1) + checkDFilterFail(dfilter, error) def test_expr_1(self, checkDFilterCount): dfilter = 'udp.port * { 10 / {5 - 4} } == udp.port * { {50 + 50} / 2 - 40 }' |