diff options
author | João Valverde <j@v6e.pt> | 2022-12-30 16:11:53 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2022-12-30 18:27:30 +0000 |
commit | bc74d2e3e42e7764b46e4f1fbfe6f4797e109c02 (patch) | |
tree | f74cb190d08060285c97cf83bfc07f58d0713685 /test | |
parent | d3d06c25527c769276c7dc2064a03717329e4f99 (diff) |
dftest: Fix command-line argument parsing
Expressions that start with hyphen clash with command-line options.
In that case we need to pass "--" to dftest to stop processing
options.
Fix the test suite to do this. Fixes failures with dftest and
expressions like:
-2 == tcp.port
Replace the GLib option parser with getopt while at it. The GLib API
is nice but isn't a good fit for this utility and the code appears to
be inconsistent on whether "--" is left in the argv or not.
Diffstat (limited to 'test')
-rw-r--r-- | test/suite_dfilter/dfiltertest.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/suite_dfilter/dfiltertest.py b/test/suite_dfilter/dfiltertest.py index 9f65ef1b3a..ca2f9860be 100644 --- a/test/suite_dfilter/dfiltertest.py +++ b/test/suite_dfilter/dfiltertest.py @@ -67,7 +67,7 @@ def checkDFilterCountWithSelectedFrame(dfilter_cmd, base_env): def checkDFilterFail(cmd_dftest, base_env): def checkDFilterFail_real(dfilter, error_message): """Run a display filter and expect dftest to fail.""" - proc = subprocess.Popen([cmd_dftest, dfilter], + proc = subprocess.Popen([cmd_dftest, '--', dfilter], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, @@ -84,7 +84,7 @@ def checkDFilterFail(cmd_dftest, base_env): def checkDFilterSucceed(cmd_dftest, base_env): def checkDFilterSucceed_real(dfilter, expect_stdout=None): """Run a display filter and expect dftest to succeed.""" - proc = subprocess.Popen([cmd_dftest, dfilter], + proc = subprocess.Popen([cmd_dftest, '--', dfilter], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, |