diff options
author | Gerald Combs <gerald@wireshark.org> | 2006-05-31 17:38:42 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2006-05-31 17:38:42 +0000 |
commit | 8958bab6dee184310e4393e33591eb0cef1f7de1 (patch) | |
tree | afe5ad59d2280ee36c0ce913a4252cddc692436f /test | |
parent | 7bc853b62b59e6cf66ba2c3a2699a8a79ef864bd (diff) | |
download | wireshark-8958bab6dee184310e4393e33591eb0cef1f7de1.tar.gz wireshark-8958bab6dee184310e4393e33591eb0cef1f7de1.tar.bz2 wireshark-8958bab6dee184310e4393e33591eb0cef1f7de1.zip |
Tethereal/tethereal -> TShark/tshark.
svn path=/trunk/; revision=18268
Diffstat (limited to 'test')
-rw-r--r-- | test/README.test | 2 | ||||
-rw-r--r-- | test/config.sh | 2 | ||||
-rw-r--r-- | test/suite-capture.sh | 20 | ||||
-rw-r--r-- | test/suite-clopts.sh | 24 | ||||
-rw-r--r-- | test/suite-io.sh | 18 | ||||
-rw-r--r-- | test/test.sh | 8 |
6 files changed, 37 insertions, 37 deletions
diff --git a/test/README.test b/test/README.test index 7734036256..4dfcf2b81f 100644 --- a/test/README.test +++ b/test/README.test @@ -7,7 +7,7 @@ What is it? This is basically a collection of bash scripts to test the command line options of: - Ethereal - - Tethereal + - TShark - Dumpcap Motivation diff --git a/test/config.sh b/test/config.sh index f35f882d0f..7a6dfa2896 100644 --- a/test/config.sh +++ b/test/config.sh @@ -28,7 +28,7 @@ ETH_BIN_PATH=../Debug_GTK2 # Tweak the following to your liking. ETHEREAL=$ETH_BIN_PATH/ethereal -TETHEREAL=$ETH_BIN_PATH/tethereal +TSHARK=$ETH_BIN_PATH/tshark CAPINFOS=$ETH_BIN_PATH/capinfos DUMPCAP=$ETH_BIN_PATH/dumpcap diff --git a/test/suite-capture.sh b/test/suite-capture.sh index a6349f5168..4315737ba2 100644 --- a/test/suite-capture.sh +++ b/test/suite-capture.sh @@ -38,7 +38,7 @@ capture_step_10packets() { test_step_failed "exit status of $DUT: $RETURNVALUE" # part of the Prerequisite checks # probably wrong interface, output the possible interfaces - $TETHEREAL -D + $TSHARK -D return fi @@ -58,7 +58,7 @@ capture_step_10packets() { cat ./testout.txt # part of the Prerequisite checks # probably wrong interface, output the possible interfaces - $TETHEREAL -D + $TSHARK -D test_step_failed "No or not enough traffic captured. Probably the wrong interface: $TRAFFIC_CAPTURE_IFACE!" fi } @@ -69,7 +69,7 @@ capture_step_10packets_stdout() { RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then test_step_failed "exit status of $DUT: $RETURNVALUE" - $TETHEREAL -D + $TSHARK -D return fi @@ -88,7 +88,7 @@ capture_step_10packets_stdout() { echo cat ./testout.txt cat ./testout2.txt - $TETHEREAL -D + $TSHARK -D test_step_failed "No or not enough traffic captured. Probably the wrong interface: $TRAFFIC_CAPTURE_IFACE!" fi } @@ -101,7 +101,7 @@ capture_step_2multi_10packets() { test_step_failed "exit status of $DUT: $RETURNVALUE" # part of the Prerequisite checks # probably wrong interface, output the possible interfaces - $TETHEREAL -D + $TSHARK -D return fi @@ -169,8 +169,8 @@ capture_step_snapshot() { return fi - # use tethereal to filter out all packets, which are larger than 68 bytes - $TETHEREAL -r ./testout.pcap -w ./testout2.pcap -R 'frame.cap_len>68' > ./testout.txt 2>&1 + # use tshark to filter out all packets, which are larger than 68 bytes + $TSHARK -r ./testout.pcap -w ./testout2.pcap -R 'frame.cap_len>68' > ./testout.txt 2>&1 # ok, we got a capture file, does it contain exactly 0 packets? $CAPINFOS ./testout2.pcap > ./testout.txt @@ -196,8 +196,8 @@ ethereal_capture_suite() { test_step_add "Capture snapshot length 68 bytes (${TRAFFIC_CAPTURE_DURATION}s)" capture_step_snapshot } -tethereal_capture_suite() { - DUT=$TETHEREAL +tshark_capture_suite() { + DUT=$TSHARK test_step_add "Capture 10 packets" capture_step_10packets test_step_add "Capture 10 packets using stdout: -w -" capture_step_10packets_stdout test_step_add "Capture read filter (${TRAFFIC_CAPTURE_DURATION}s)" capture_step_read_filter @@ -225,7 +225,7 @@ capture_suite() { test_step_set_pre capture_cleanup_step test_step_set_post capture_cleanup_step test_remark_add "Capture - need some traffic on interface: \"$TRAFFIC_CAPTURE_IFACE\"" - test_suite_add "Tethereal capture" tethereal_capture_suite + test_suite_add "TShark capture" tshark_capture_suite test_suite_add "Ethereal capture" ethereal_capture_suite test_suite_add "Dumpcap capture" dumpcap_capture_suite } diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh index be718d49d7..f02a073aa3 100644 --- a/test/suite-clopts.sh +++ b/test/suite-clopts.sh @@ -30,7 +30,7 @@ EXIT_ERROR=2 # generic: check against a specific exit status with a single char option -# $1 command: tethereal +# $1 command: tshark # $2 option: a # $3 expected exit status: 0 test_single_char_options() @@ -49,7 +49,7 @@ test_single_char_options() # check exit status when reading an existing file clopts_step_existing_file() { - $TETHEREAL -r $CAPFILE > ./testout.txt 2>&1 + $TSHARK -r $CAPFILE > ./testout.txt 2>&1 RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then test_step_failed "exit status: $RETURNVALUE" @@ -62,7 +62,7 @@ clopts_step_existing_file() { # check exit status when reading a none existing file clopts_step_nonexisting_file() { - $TETHEREAL -r ThisFileDontExist.pcap > ./testout.txt 2>&1 + $TSHARK -r ThisFileDontExist.pcap > ./testout.txt 2>&1 RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_ERROR ]; then test_step_failed "exit status: $RETURNVALUE" @@ -74,10 +74,10 @@ clopts_step_nonexisting_file() { # check exit status of all single char option being invalid -clopts_suite_tethereal_invalid_chars() { +clopts_suite_tshark_invalid_chars() { for index in A B C E F H I J K M N O P Q R T U W X Y Z a b c d e f g i j k m o r s t u w y z do - test_step_add "Invalid Tethereal parameter -$index, exit status must be $EXIT_COMMAND_LINE" "test_single_char_options $TETHEREAL $index $EXIT_COMMAND_LINE" + test_step_add "Invalid TShark parameter -$index, exit status must be $EXIT_COMMAND_LINE" "test_single_char_options $TSHARK $index $EXIT_COMMAND_LINE" done } @@ -86,7 +86,7 @@ clopts_suite_tethereal_invalid_chars() { clopts_suite_valid_chars() { for index in D G L h v do - test_step_add "Valid Tethereal parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $TETHEREAL $index $EXIT_OK" + test_step_add "Valid TShark parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $TSHARK $index $EXIT_OK" done } @@ -95,7 +95,7 @@ clopts_suite_valid_chars() { # check exit status and grep output string of an invalid capture filter clopts_step_invalid_capfilter() { - $TETHEREAL -f 'jkghg' -w './testout.pcap' > ./testout.txt 2>&1 + $TSHARK -f 'jkghg' -w './testout.pcap' > ./testout.txt 2>&1 RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then test_step_failed "exit status: $RETURNVALUE" @@ -112,7 +112,7 @@ clopts_step_invalid_capfilter() { # check exit status and grep output string of an invalid interface clopts_step_invalid_interface() { - $TETHEREAL -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1 + $TSHARK -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1 RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then test_step_failed "exit status: $RETURNVALUE" @@ -130,7 +130,7 @@ clopts_step_invalid_interface() { # check exit status and grep output string of an invalid interface index # (valid interface indexes start with 1) clopts_step_invalid_interface_index() { - $TETHEREAL -i 0 -w './testout.pcap' > ./testout.txt 2>&1 + $TSHARK -i 0 -w './testout.pcap' > ./testout.txt 2>&1 RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_COMMAND_LINE ]; then test_step_failed "exit status: $RETURNVALUE" @@ -148,7 +148,7 @@ clopts_step_invalid_interface_index() { # check exit status and grep output string of an invalid capture filter # XXX - how to efficiently test the *invalid* flags? clopts_step_valid_name_resolving() { - $TETHEREAL -N mntC -a duration:1 > ./testout.txt 2>&1 + $TSHARK -N mntC -a duration:1 > ./testout.txt 2>&1 RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then test_step_failed "exit status: $RETURNVALUE" @@ -171,8 +171,8 @@ clopts_post_step() { clopt_suite() { test_step_set_post clopts_post_step test_suite_add "Basic tests" clopts_suite_basic - test_suite_add "Invalid Tethereal single char options" clopts_suite_tethereal_invalid_chars - test_suite_add "Valid Tethereal single char options" clopts_suite_valid_chars + test_suite_add "Invalid TShark single char options" clopts_suite_tshark_invalid_chars + test_suite_add "Valid TShark single char options" clopts_suite_valid_chars test_step_add "Invalid capture filter -f" clopts_step_invalid_capfilter test_step_add "Invalid capture interface -i" clopts_step_invalid_interface test_step_add "Invalid capture interface index 0" clopts_step_invalid_interface_index diff --git a/test/suite-io.sh b/test/suite-io.sh index f3f87adf9d..ebcfdedfd7 100644 --- a/test/suite-io.sh +++ b/test/suite-io.sh @@ -38,7 +38,7 @@ io_step_input_file() { test_step_failed "exit status of $DUT: $RETURNVALUE" # part of the Prerequisite checks # probably wrong interface, output the possible interfaces - $TETHEREAL -D + $TSHARK -D return fi @@ -58,7 +58,7 @@ io_step_input_file() { cat ./testout.txt # part of the Prerequisite checks # probably wrong interface, output the possible interfaces - $TETHEREAL -D + $TSHARK -D test_step_failed "No or not enough traffic captured. Probably the wrong interface: $TRAFFIC_CAPTURE_IFACE!" fi } @@ -69,7 +69,7 @@ io_step_output_piping() { RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then test_step_failed "exit status of $DUT: $RETURNVALUE" - $TETHEREAL -D + $TSHARK -D return fi @@ -88,7 +88,7 @@ io_step_output_piping() { echo cat ./testout.txt cat ./testout2.txt - $TETHEREAL -D + $TSHARK -D test_step_failed "No or not enough traffic captured. Probably the wrong interface: $TRAFFIC_CAPTURE_IFACE!" fi } @@ -98,7 +98,7 @@ io_step_input_piping() { cat -B dhcp.pcap | $DUT -r - -w ./testout.pcap 2>./testout.txt RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then - $TETHEREAL -D + $TSHARK -D echo cat ./testout.txt test_step_failed "exit status of $DUT: $RETURNVALUE" @@ -120,7 +120,7 @@ io_step_input_piping() { echo cat ./testout.txt cat ./testout2.txt - $TETHEREAL -D + $TSHARK -D test_step_failed "No or not enough traffic captured. Probably the wrong interface: $TRAFFIC_CAPTURE_IFACE!" fi } @@ -131,8 +131,8 @@ ethereal_io_suite() { test_step_add "Input file" io_step_input_file } -tethereal_io_suite() { - DUT=$TETHEREAL +tshark_io_suite() { + DUT=$TSHARK test_step_add "Input file" io_step_input_file test_step_add "Output piping" io_step_output_piping #test_step_add "Piping" io_step_input_piping @@ -155,7 +155,7 @@ io_cleanup_step() { io_suite() { test_step_set_pre io_cleanup_step test_step_set_post io_cleanup_step - test_suite_add "Tethereal file I/O" tethereal_io_suite + test_suite_add "TShark file I/O" tshark_io_suite #test_suite_add "Ethereal file I/O" ethereal_io_suite #test_suite_add "Dumpcap file I/O" dumpcap_io_suite } diff --git a/test/test.sh b/test/test.sh index 368a84fe1f..d60408e46b 100644 --- a/test/test.sh +++ b/test/test.sh @@ -39,7 +39,7 @@ source suite-capture.sh test_step_prerequisites() { NOTFOUND=0 - for i in "$ETHEREAL" "$TETHEREAL" "$CAPINFOS" "$DUMPCAP" ; do + for i in "$ETHEREAL" "$TSHARK" "$CAPINFOS" "$DUMPCAP" ; do if [ ! -x $i ]; then echo "Couldn't find $i" NOTFOUND=1 @@ -71,8 +71,8 @@ test_suite() { test_set_output VERBOSE -#test_suite_run "Tethereal command line options" clopt_suite -#test_suite_run "Tethereal capture" capture_suite +#test_suite_run "TShark command line options" clopt_suite +#test_suite_run "TShark capture" capture_suite # all @@ -171,4 +171,4 @@ done ;; esac -done
\ No newline at end of file +done |