Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Reassembly code not working after change to use tvbuffs

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Sun, 14 Jul 2013 16:37:06 -0700
On Jul 14, 2013, at 4:02 PM, Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx> wrote:

> Great to have some regression tests, thanks. Can you run tests on r50593?

In progress as we speak.  No errors yet.

Just in case anybody wants to see the "tools" I'm using, here's the top-level script that runs regressions.  I keep my collection of captures in ~/captures, and that's wired into the script; generalizing or modifying is left as an exercise for the reader.

The usage message lies - it only takes one argument; that was part of an attempt to let it pass on arguments such as -2 to TShark (see below).

It filters out images because, at the time I wrote it, we didn't dissect them; I should probably remove the filtering out of JPEGs, for example.

Attachment: regresscaps
Description: Binary data


Here's an example of the type of script it runs to do a regression on a single file.  If I'm running a regression in the "wireshark.{whatever}" directory, it expects "../wireshark.{whatever}-baseline" to contain the baseline Wireshark against which I'm regressing; my scripts have that hardwired in, because I'm too lazy to make it dig it out of $CWD.

Note also that it expects a shell where you can use <(command) to run a command and pass a /dev/fd/N for the standard output of the command as an argument, so that cmp can read from two tsharks piped to it (originally done to keep from doing tons of writes to the flash drive that is the only drive on the laptop on which I run this, but it also runs faster due to running two tsharks in parallel on said multi-core laptop and not actually doing file system writes); that's why it has /bin/bash in the #! line.  (I'm too lazy to see if that's in the current POSIX spec for the shell.)

It also supports, for a capture file named "foo", a file in the same directory named "foo.options" containing options with which to run TShark (typically -o flags).

I also now tend to run it twice, once without the -2 flag and once with the -2 flag, to make sure that things work correctly regardless of whether you're doing the dissection when reading the file in or in a subsequent pass after having read it in.  (And, yes, I'm too lazy to make that an option to the script, or, having done so, to make regresscaps do both runs. :-))

The setting of LANG dates back, I think, to when I was running this on something other than OS X; the default on OS X is UTF-8, not ISO Latin 1.

The repeated occurrence of the word "lazy" indicates why I put "tools" in quotes. :-)

Attachment: doit
Description: Binary data


That's run inside another script:

Attachment: runshark
Description: Binary data


to keep crashes from tshark from making the doit script immediately bail out, as I remember.