Commit Graph

29 Commits

Author SHA1 Message Date
Gerald Combs 30c392f166 Tools+test: Call python3 explicitly.
PEP 394[1] says,

"In cases where the script is expected to be executed outside virtual
 environments, developers will need to be aware of the following
 discrepancies across platforms and installation methods:

  * Older Linux distributions will provide a python command that refers
    to Python 2, and will likely not provide a python2 command.

  * Some newer Linux distributions will provide a python command that
    refers to Python 3.

  * Some Linux distributions will not provide a python command at all by
    default, but will provide a python3 command by default."

Debian has forced the issue by choosing the third option[2]:

"NOTE: Debian testing (bullseye) has removed the "python" package and
 the '/usr/bin/python' symlink due to the deprecation of Python 2."

Switch our shebang from "#!/usr/bin/env python" to "#!/usr/bin/env
python3" in some places. Remove some 2/3 version checks if we know we're
running under Python 3. Remove the "coding: utf-8" in a bunch of places
since that's the default in Python 3.

[1]https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers
[2]https://wiki.debian.org/Python
2020-11-05 06:46:35 +00:00
Dario Lombardo 8a5385b9c9 More licenses converted to SPDX.
Change-Id: Id4f987dcdacf06622d70263f4659a4400e30dc39
Reviewed-on: https://code.wireshark.org/review/26332
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 13:35:49 +00:00
Peter Wu 1ba4191c70 indexcap.py: fix tmpdir handling, python 3 compat
Add Python 3 compatibility to indexcap.py and only create a tmpdir for
actions that need it. Only remove tmpdir for the compare action and
try to remove the temp dir even if an exception occurs.

In list_protos_in_cap.sh, rename BIN_DIR to WS_BIN_PATH (matching
test/config.sh) and allow it to be overridden from the environment.

Tested with Python 2.6.6, 2.7.9, 3.2.6, 3.4.3 as follows (with tshark
built using cmake and '-b /tmp/wsbuild/run'):

    tools/indexcap.py out pop-ssl.pcapng;
    tools/indexcap.py out pop-ssl.pcapng --list-all-proto;
    tools/indexcap.py out pop-ssl.pcapng --list-all-files;
    tools/indexcap.py out pop-ssl.pcapng --list-all-proto-files=ssl;
    rm out;

Python 2.5.6 does not work (there is no multiprocessing module). The
dict output in Python 3.4.3 is different (has the hash function
changed?)

Change-Id: I592d8c4458a20d5088d815c6dd1cf90c9d3df9d3
Reviewed-on: https://code.wireshark.org/review/7792
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-25 07:09:41 +00:00
Alexis La Goutte 82f11d4204 Fix indexcap tools
Change-Id: Ib77af11975873106b7db7ac1bcd12f4a0800b59e
TypeError: extract_protos_from_file() takes exactly 6 arguments (7 given)
Reviewed-on: https://code.wireshark.org/review/779
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-21 21:56:22 +00:00
Jeff Morriss 82e2865739 Remove $Id$ and other Subversion leftovers from the tools.
There are a few things in here which could still use attention.

Don't regenerate anything now.

Change-Id: I283c224d3523212144707fca3d6265916cb11792
Reviewed-on: https://code.wireshark.org/review/205
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-14 01:35:57 +00:00
Jeff Morriss b667cc5a99 Add comments to point out that these 2 scripts do the same thing.
svn path=/trunk/; revision=44175
2012-07-31 23:16:26 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Kovarththanan Rajaratnam ea9fca6f4b Default to number of CPUs available
svn path=/trunk/; revision=30591
2009-10-18 08:33:40 +00:00
Kovarththanan Rajaratnam f1f6777548 Remove temporary directory on shutdown
svn path=/trunk/; revision=30504
2009-10-11 10:45:48 +00:00
Kovarththanan Rajaratnam ba79395fc5 Add an option to randomize file list order
svn path=/trunk/; revision=30503
2009-10-11 10:39:21 +00:00
Kovarththanan Rajaratnam 539980f441 Remember to create a temporary directory before dissecting
svn path=/trunk/; revision=30486
2009-10-11 05:14:04 +00:00
Kovarththanan Rajaratnam 2f66e4ae29 Delete log files from test runs that were succesful
svn path=/trunk/; revision=30170
2009-09-26 11:48:13 +00:00
Kovarththanan Rajaratnam 0638d407b7 * Redirect stdout/stderr to temporary files
* Do file comparison on stdout/stderr output

svn path=/trunk/; revision=30169
2009-09-26 11:05:59 +00:00
Kovarththanan Rajaratnam d557791862 Start implementing 'compare against baseline'. When fully implemented we'll be able to compare any changes that we've made to the working directory against a clean/baseline version of tshark.
svn path=/trunk/; revision=30168
2009-09-26 09:48:46 +00:00
Kovarththanan Rajaratnam 386a463b32 Add support for running tshark (-d) on a set of files matching a certains protocols (--list-all-proto-files). The index file is used to search for the files matching the given protocol(s)
svn path=/trunk/; revision=30167
2009-09-26 09:03:26 +00:00
Kovarththanan Rajaratnam 0775f97f19 Look for both tshark and tshark.exe
svn path=/trunk/; revision=30166
2009-09-26 07:13:48 +00:00
Kovarththanan Rajaratnam 2f2dc6d571 Add option to dump all files containing a protocol (possibly a comma delimited list of protocols)
svn path=/trunk/; revision=30160
2009-09-26 03:48:04 +00:00
Stephen Fisher 426870cd90 Set the usual properties + executable:
Name: svn:executable
   + *
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native


svn path=/trunk/; revision=30157
2009-09-25 21:12:34 +00:00
Kovarththanan Rajaratnam de10fd22a6 Handle keyboard interrupts gracefully
svn path=/trunk/; revision=30156
2009-09-25 21:01:28 +00:00
Kovarththanan Rajaratnam e45956edbe * Cleanup print
* Remove timeout (this wasn't correctly implemented)

svn path=/trunk/; revision=30155
2009-09-25 20:50:51 +00:00
Kovarththanan Rajaratnam eea92c8b2c Use timeout to keep the file progress printing smooth
svn path=/trunk/; revision=30153
2009-09-25 19:41:54 +00:00
Kovarththanan Rajaratnam 7658f9a43a Use apply_async and print out file progress in the parent process
svn path=/trunk/; revision=30152
2009-09-25 19:02:32 +00:00
Kovarththanan Rajaratnam 8ff8f868c1 Refactoring: add find_capture_files()
svn path=/trunk/; revision=30150
2009-09-25 17:47:25 +00:00
Kovarththanan Rajaratnam 8bd432e940 Add option to dump all files in index file
svn path=/trunk/; revision=30149
2009-09-25 17:43:01 +00:00
Kovarththanan Rajaratnam a56f547bee Add option to dump all protocols in index file
svn path=/trunk/; revision=30148
2009-09-25 17:28:53 +00:00
Kovarththanan Rajaratnam 2216640d8c * Handle some error path more gracefully
* Add more verbose output

svn path=/trunk/; revision=30147
2009-09-25 17:03:44 +00:00
Kovarththanan Rajaratnam 50b7a98610 Use pickle to store the results into the index file
svn path=/trunk/; revision=30146
2009-09-25 15:41:17 +00:00
Kovarththanan Rajaratnam 8f38bae049 Add initial multiprocessing support
svn path=/trunk/; revision=30143
2009-09-25 15:02:57 +00:00
Kovarththanan Rajaratnam e77667b2ad The beginning of a Python script/tool that indexes capture files. It currently extracts all protocols that appear in the given capture files.
svn path=/trunk/; revision=30120
2009-09-24 19:02:49 +00:00