aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite_clopts.py
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2023-10-12 09:23:53 -0400
committerJohn Thacker <johnthacker@gmail.com>2023-10-14 14:02:04 +0000
commit5c420697d6500e0a039afcd791322f53609e303a (patch)
treefa39b39ffb8e2f9efc2b77eff6a0d72649bdde80 /test/suite_clopts.py
parent3a636f339f49ee321cc19aad05fe855b99ca5a46 (diff)
tshark: Support --read-file and filter long opts
The tshark man page and help claims to support the --read-file, --read-filter, and --display-filter long options. Make it so. Programs have to dissect in order to run filters, so add the filtering options to dissect_opts.h, which Wireshark, tshark, and rawshark already include, so that they stay consistent between applications. Reading a file is a common activity that we might want to have more (all?) command line tools support with the same syntax eventually, so add that to clopts_common.h rawshark doesn't distinguish between read filters and display filters; to make things easy and consistent, make them synonymous for rawshark. Fix #19365
Diffstat (limited to 'test/suite_clopts.py')
-rw-r--r--test/suite_clopts.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/suite_clopts.py b/test/suite_clopts.py
index 2064fc4f88..d13f96cc86 100644
--- a/test/suite_clopts.py
+++ b/test/suite_clopts.py
@@ -79,6 +79,12 @@ class TestBasicClopts:
process = subprocesstest.run((cmd_tshark, '-r', capture_file('dhcp.pcap')), env=test_env)
assert process.returncode == ExitCodes.OK
+ def test_existing_file_longopt(self, cmd_tshark, capture_file, test_env):
+ # $TSHARK -r "${CAPTURE_DIR}dhcp.pcap" > ./testout.txt 2>&1
+ process = subprocesstest.run((cmd_tshark, '--read-file', capture_file('dhcp.pcap'),
+ '--display-filter', 'dhcp'), env=test_env)
+ assert process.returncode == ExitCodes.OK
+
def test_nonexistent_file(self, cmd_tshark, capture_file, test_env):
# $TSHARK - r ThisFileDontExist.pcap > ./testout.txt 2 > &1
process = subprocesstest.run((cmd_tshark, '-r', capture_file('__ceci_nest_pas_une.pcap')), env=test_env)