Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose of new structure and associated scripts #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

jnovak-netsystemcz
Copy link

The general idea of proposed change is to add background information about the sample - publisher should describe what sample contains and why the sample is added to repository (e.g. unusual packet flow or headers, ...). There should be described requirements how the sample should be decoded - e.g. new header should be decoded in compare to previous Wireshark release.
For regression tests, pdml and txt output is stored and it is known which release of Wireshark produced it (only main.minor number is stored).

Scripts are now able to:

  • check if sample is complete (description, requirements for decoding, pcap sample)
  • generate outputs in pdml and txt for new samples (version of tshark can be specified)
  • verify pdml and txt for any sample
  • specify which stored version of files should be used for compare

Copy link
Member

@Lekensteyn Lekensteyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Jirka, thank you for your proposed change!

Global comments:

  • Dependency tracking is unfortunately broken after this patch, so even if a test or its config has not changed, it will still re-run tests.
  • I think it is better to have an "unversioned" test too (to track the development branch) and only add an override for specific versions if these turn out to be incompatible. You will probably need at least a new PDML file, if a new XSL file is needed, we can revisit that later. (The original version where the test was tried with can be added in a commit messary if necessary.)
  • Original Makefile was minimalistic and intentionally lacked "features" that are not used. What about removing the "no_pdml" and "no_text" options? Let this be implicit from missing PDML/text files?

Do we really need to test the text output if we already have PDML output? Granted, the Protocol and Info column are not tested, but is that something that is likely to cause issues that are not detected from the PDML output?

Perhaps tshark also needs to be run with HOME=$(mktemp -d) or something, it seems that your preferences contains additional columns that are not present in the default config.

Tentative verdict: it looks more complex now, I would prefer something more readable than Bash (Python?) if more logic is needed, but acknowledge that the "do-ers" will move this project forward :-)

TYPE="$3"
REQ_VERSION="$4"

${TSHARK_EXECUTABLE} --version > /dev/null 2> /dev/null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be quoted like "${TSHARK_EXECUTABLE}" (same below)?

fi

if [ ! -f "${OUTPUT_FILE}" -o ${FILE_PCAP} -nt ${OUTPUT_FILE} ]; then
"${TSHARK_EXECUTABLE}" $TSHARK_ARGS -T ${XTYPE} ${XARGS} -r "${FILE_PCAP}" > "${OUTPUT_FILE}".tmp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed opportunity for parallelism here I think, now single-pass cannot run together with -2

Makefile Outdated
%.text.current:
@./scripts/sample_test.sh "$(TSHARK_EXECUTABLE)" "$(basename $(basename $@))" text $(SELECTED_VERSIONS)

all:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the default target should still be "test" and that this information belongs in the README (or make help if you still want a summary).

--------------------------------------

SUPPORTED_VERSIONS - list of versions checked during make or make outputs, when not specified, default in Makefile is used
VERSION - version used for make or make outputs, when not specified, tshark version is used
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe WS_VERSION (to make clearer that this is not some other version)?

if [ -f "${FILE}.pcap.gz" ]; then
FILE_PCAP="${FILE}.pcap.gz"
elif [ -f "${FILE}.pcapng.gz" ]; then
FILE_PCAP="${FILE}.pcapng.gz"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are capture formats other than (compressed) pcap like android logcat, etc. What do you think about using a single extension (like FOO.pcap or FOO.cap) even if it is compressed? Otherwise we might have a lot of files here.

Alternatively, we can stick to the original convention of looking for FOO given FOO.pdml (e.g. dns.pcapng.pdml)

@jnovak-netsystemcz
Copy link
Author

jnovak-netsystemcz commented Mar 29, 2017 via email

@jnovak-netsystemcz
Copy link
Author

jnovak-netsystemcz commented Feb 20, 2018 via email

@Lekensteyn
Copy link
Member

Lekensteyn commented Feb 23, 2018

Hi Jirka,

Sorry for the long delay, there is indeed not much development here. Testing is still much needed, but the exact approach is still not set in stone. I guess that only by experimentation (like the original happy-shark), we can learn what works best.

Feel free to create new samples as needed, and note that no activity from my side does not mean that I disapprove of your approach, but just lack of time to carefully look at it.

Edit: should you have any questions or comments, feel free to drop a comment though!

@jnovak-netsystemcz
Copy link
Author

jnovak-netsystemcz commented Feb 28, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants