diff --git a/test/suite-capture.sh b/test/suite-capture.sh index a3bfc0dc5f..16b5719c5e 100755 --- a/test/suite-capture.sh +++ b/test/suite-capture.sh @@ -35,9 +35,9 @@ capture_test_output_print() { wait for f in "$@"; do if [[ -f "$f" ]]; then - printf " --> $f\n" - cat "$f" - printf "\n" + printf " --> $f\n" + cat "$f" + printf "\n" fi done } @@ -113,7 +113,7 @@ capture_step_10packets() { test_step_ok else echo - $TSHARK -ta -r ./testout.pcap >> ./testout2.txt + $TSHARK -ta -r ./testout.pcap >> ./testout2.txt capture_test_output_print ./testout_ping.txt ./testout.txt ./testout2.txt # part of the Prerequisite checks # probably wrong interface, output the possible interfaces @@ -124,10 +124,10 @@ capture_step_10packets() { # capture exactly 10 packets using "-w -" (piping to stdout) capture_step_10packets_stdout() { - if [ $SKIP_CAPTURE -ne 0 ] ; then - test_step_skipped - return - fi + if [ $SKIP_CAPTURE -ne 0 ] ; then + test_step_skipped + return + fi traffic_gen_ping @@ -203,16 +203,16 @@ capture_step_fifo() { # capture packets via a fifo capture_step_stdin() { - CONSOLE_LOG_ARGS="" - if [ "$DUT" == "$WIRESHARK_CMD" -a "$WS_SYSTEM" == "Windows" ] ; then - CONSOLE_LOG_ARGS="-o console.log.level:127" - fi + CONSOLE_LOG_ARGS="" + if [ "$DUT" == "$WIRESHARK_CMD" -a "$WS_SYSTEM" == "Windows" ] ; then + CONSOLE_LOG_ARGS="-o console.log.level:127" + fi (cat "${CAPTURE_DIR}dhcp.pcap"; sleep 1; tail -c +25 "${CAPTURE_DIR}dhcp.pcap") | \ $DUT -i - $TRAFFIC_CAPTURE_PROMISC \ -w ./testout.pcap \ -a duration:$TRAFFIC_CAPTURE_DURATION \ - $CONSOLE_LOG_ARGS \ + $CONSOLE_LOG_ARGS \ > ./testout.txt 2> ./testerr.txt RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then @@ -221,22 +221,22 @@ capture_step_stdin() { return fi - if [ -n "$CONSOLE_LOG_ARGS" ] ; then - grep "Wireshark is up and ready to go" ./testout.txt > /dev/null 2>&1 - if [ $? -ne 0 ]; then - test_step_failed "No startup message!" - fi + if [ -n "$CONSOLE_LOG_ARGS" ] ; then + grep "Wireshark is up and ready to go" ./testout.txt > /dev/null 2>&1 + if [ $? -ne 0 ]; then + test_step_failed "No startup message!" + fi - grep "Capture started" ./testerr.txt > /dev/null 2>&1 - if [ $? -ne 0 ]; then - test_step_failed "No capture started message!" - fi + grep "Capture started" ./testerr.txt > /dev/null 2>&1 + if [ $? -ne 0 ]; then + test_step_failed "No capture started message!" + fi - grep "Capture stopped" ./testerr.txt > /dev/null 2>&1 - if [ $? -ne 0 ]; then - test_step_failed "No capture stopped message!" - fi - fi + grep "Capture stopped" ./testerr.txt > /dev/null 2>&1 + if [ $? -ne 0 ]; then + test_step_failed "No capture stopped message!" + fi + fi # we should have an output file now if [ ! -f "./testout.pcap" ]; then @@ -258,10 +258,10 @@ capture_step_stdin() { # capture exactly 2 times 10 packets (multiple files) capture_step_2multi_10packets() { - if [ $SKIP_CAPTURE -ne 0 ] ; then - test_step_skipped - return - fi + if [ $SKIP_CAPTURE -ne 0 ] ; then + test_step_skipped + return + fi traffic_gen_ping @@ -305,10 +305,10 @@ capture_step_2multi_10packets() { # capture with a very unlikely read filter, packets must be zero afterwards capture_step_read_filter() { - if [ $SKIP_CAPTURE -ne 0 ] ; then - test_step_skipped - return - fi + if [ $SKIP_CAPTURE -ne 0 ] ; then + test_step_skipped + return + fi traffic_gen_ping @@ -470,3 +470,17 @@ capture_suite() { test_suite_add "TShark capture" tshark_capture_suite test_suite_add "Wireshark capture" wireshark_capture_suite } + +# +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 +# tab-width: 8 +# indent-tabs-mode: t +# End: +# +# vi: set shiftwidth=8 tabstop=8 noexpandtab: +# :indentSize=8:tabSize=8:noTabs=false: +# + diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh index a564b7d929..c474f5fd95 100755 --- a/test/suite-clopts.sh +++ b/test/suite-clopts.sh @@ -57,7 +57,7 @@ test_single_char_options() clopts_suite_dumpcap_invalid_chars() { for index in C E F G H J K N O Q R T U V W X Y e j l o x z do - test_step_add "Invalid dumpcap parameter -$index, exit status must be $EXIT_COMMAND_LINE" "test_single_char_options $DUMPCAP $index $EXIT_COMMAND_LINE" + test_step_add "Invalid dumpcap parameter -$index, exit status must be $EXIT_COMMAND_LINE" "test_single_char_options $DUMPCAP $index $EXIT_COMMAND_LINE" done } @@ -67,7 +67,7 @@ clopts_suite_dumpcap_invalid_chars() { clopts_suite_dumpcap_valid_chars() { for index in h v do - test_step_add "Valid dumpcap parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $DUMPCAP $index $EXIT_OK" + test_step_add "Valid dumpcap parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $DUMPCAP $index $EXIT_OK" done } @@ -76,20 +76,20 @@ clopts_suite_dumpcap_valid_chars() { clopts_suite_dumpcap_interface_chars() { for index in D L do - if [ "$SKIP_CAPTURE" -eq 0 ] ; then - test_step_add "Valid dumpcap parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $DUMPCAP $index $EXIT_OK" - else - test_step_add "Invalid permissions for dumpcap parameter -$index, exit status must be $EXIT_ERROR" "test_single_char_options $DUMPCAP $index $EXIT_ERROR" - fi - done + if [ "$SKIP_CAPTURE" -eq 0 ] ; then + test_step_add "Valid dumpcap parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $DUMPCAP $index $EXIT_OK" + else + test_step_add "Invalid permissions for dumpcap parameter -$index, exit status must be $EXIT_ERROR" "test_single_char_options $DUMPCAP $index $EXIT_ERROR" + fi + done } # check exit status and grep output string of an invalid capture filter clopts_step_dumpcap_invalid_capfilter() { - if [ "$WS_SYSTEM" != "Windows" ] ; then - test_step_skipped - return - fi + if [ "$WS_SYSTEM" != "Windows" ] ; then + test_step_skipped + return + fi $DUMPCAP -f 'jkghg' -w './testout.pcap' > ./testout.txt 2>&1 RETURNVALUE=$? @@ -175,7 +175,7 @@ clopts_step_nonexisting_file() { clopts_suite_tshark_invalid_chars() { for index in A B C E F H J K M N O R T U W X Y Z a b c d e f i j k m o r s t u w y z do - test_step_add "Invalid TShark parameter -$index, exit status must be $EXIT_COMMAND_LINE" "test_single_char_options $TSHARK $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 } @@ -184,7 +184,7 @@ clopts_suite_tshark_invalid_chars() { clopts_suite_tshark_valid_chars() { for index in G h v do - test_step_add "Valid TShark parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $TSHARK $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 } @@ -193,22 +193,22 @@ clopts_suite_tshark_valid_chars() { clopts_suite_tshark_interface_chars() { for index in D L do - if [ "$SKIP_CAPTURE" -eq 0 ] ; then - test_step_add "Valid TShark parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $TSHARK $index $EXIT_OK" - else - test_step_add "Invalid permissions for TShark parameter -$index, exit status must be $EXIT_ERROR" "test_single_char_options $TSHARK $index $EXIT_ERROR" - fi - done + if [ "$SKIP_CAPTURE" -eq 0 ] ; then + test_step_add "Valid TShark parameter -$index, exit status must be $EXIT_OK" "test_single_char_options $TSHARK $index $EXIT_OK" + else + test_step_add "Invalid permissions for TShark parameter -$index, exit status must be $EXIT_ERROR" "test_single_char_options $TSHARK $index $EXIT_ERROR" + fi + done } # S V l n p q x # check exit status and grep output string of an invalid capture filter clopts_step_tshark_invalid_capfilter() { - if [ "$WS_SYSTEM" != "Windows" ] ; then - test_step_skipped - return - fi + if [ "$WS_SYSTEM" != "Windows" ] ; then + test_step_skipped + return + fi $TSHARK -f 'jkghg' -w './testout.pcap' > ./testout.txt 2>&1 RETURNVALUE=$? @@ -265,10 +265,10 @@ clopts_step_tshark_invalid_interfaces_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() { - if [ "$WS_SYSTEM" != "Windows" ] ; then - test_step_skipped - return - fi + if [ "$WS_SYSTEM" != "Windows" ] ; then + test_step_skipped + return + fi $TSHARK -N mntC -a duration:1 > ./testout.txt 2>&1 RETURNVALUE=$? @@ -317,9 +317,16 @@ clopt_suite() { #test_remark_add "Options currently unchecked: S, V, l, n, p, q and x" } -## Emacs -## Local Variables: -## tab-width: 8 -## indent-tabs-mode: t -## sh-basic-offset: 8 -## End: +# +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 +# tab-width: 8 +# indent-tabs-mode: t +# End: +# +# vi: set shiftwidth=8 tabstop=8 noexpandtab: +# :indentSize=8:tabSize=8:noTabs=false: +# + diff --git a/test/suite-decryption.sh b/test/suite-decryption.sh index e843a12739..ccf5239181 100755 --- a/test/suite-decryption.sh +++ b/test/suite-decryption.sh @@ -51,7 +51,7 @@ UAT_FILES=" TEST_KEYS_DIR="$PWD/keys/" if [ "$WS_SYSTEM" == "Windows" ] ; then - TEST_KEYS_DIR="`cygpath -w $TEST_KEYS_DIR`" + TEST_KEYS_DIR="`cygpath -w $TEST_KEYS_DIR`" fi #TS_ARGS="-Tfields -e frame.number -e frame.time_epoch -e frame.time_delta" @@ -163,13 +163,16 @@ decryption_suite() { test_suite_add "TShark decryption" tshark_decryption_suite } -# Editor modelines # -# Local Variables: -# sh-basic-offset: 8 +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 # tab-width: 8 # indent-tabs-mode: t # End: # -# ex: set shiftwidth=8 tabstop=8 noexpandtab: +# vi: set shiftwidth=8 tabstop=8 noexpandtab: # :indentSize=8:tabSize=8:noTabs=false: +# + diff --git a/test/suite-fileformats.sh b/test/suite-fileformats.sh index 52651e2a20..09f279c0aa 100755 --- a/test/suite-fileformats.sh +++ b/test/suite-fileformats.sh @@ -153,14 +153,15 @@ fileformats_suite() { #test_suite_add "Wireshark file format" wireshark_ff_suite #test_suite_add "Editcap file format" editcap_ff_suite } - -# Editor modelines # -# Local Variables: -# sh-basic-offset: 8 +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 # tab-width: 8 # indent-tabs-mode: t # End: # -# ex: set shiftwidth=8 tabstop=8 noexpandtab: +# vi: set shiftwidth=8 tabstop=8 noexpandtab: # :indentSize=8:tabSize=8:noTabs=false: +# diff --git a/test/suite-io.sh b/test/suite-io.sh index a605004c44..79a9d573e0 100755 --- a/test/suite-io.sh +++ b/test/suite-io.sh @@ -159,3 +159,15 @@ io_suite() { #test_suite_add "Wireshark file I/O" wireshark_io_suite #test_suite_add "Dumpcap file I/O" dumpcap_io_suite } +# +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 +# tab-width: 8 +# indent-tabs-mode: t +# End: +# +# vi: set shiftwidth=8 tabstop=8 noexpandtab: +# :indentSize=8:tabSize=8:noTabs=false: +# diff --git a/test/suite-unittests.sh b/test/suite-unittests.sh index 4e2c7c817c..d87563b820 100755 --- a/test/suite-unittests.sh +++ b/test/suite-unittests.sh @@ -37,9 +37,9 @@ unittests_step_test() { return fi - # if we're on windows, we have to copy the test exe to the wireshark-gtk2 - # dir before we can use them. - # {Note that 'INSTALL_DIR' must be a Windows Pathname) + # if we're on windows, we have to copy the test exe to the wireshark-gtk2 + # dir before we can use them. + # {Note that 'INSTALL_DIR' must be a Windows Pathname) if [ "$WS_SYSTEM" == "Windows" ] ; then (cd `dirname $DUT` && $MAKE `basename $DUT`_install INSTALL_DIR='wireshark-gtk2\') > testout.txt 2>&1 if [ $? -ne 0 ]; then @@ -89,3 +89,15 @@ unittests_suite() { test_step_add "reassemble_test" unittests_step_reassemble_test test_step_add "tvbtest" unittests_step_tvbtest } +# +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 +# tab-width: 8 +# indent-tabs-mode: t +# End: +# +# vi: set shiftwidth=8 tabstop=8 noexpandtab: +# :indentSize=8:tabSize=8:noTabs=false: +# diff --git a/test/test-backend.sh b/test/test-backend.sh index 8c2b429f84..1dba9ba4d9 100755 --- a/test/test-backend.sh +++ b/test/test-backend.sh @@ -37,17 +37,17 @@ # coloring the output if [ $USE_COLOR -eq 1 ] ; then - color_reset="tput sgr0" - color_green='' - color_red='' - color_yellow='' - color_blue='' + color_reset="tput sgr0" + color_green='' + color_red='' + color_yellow='' + color_blue='' else - color_reset="true" - color_green='' - color_red='' - color_yellow='' - color_blue='' + color_reset="true" + color_green='' + color_red='' + color_yellow='' + color_blue='' fi # runtime flags @@ -198,7 +198,6 @@ test_suite_add() { echo " Suite: $1 (${TEST_STEPS[TEST_NESTING_LEVEL+1]} subitems)" $color_reset fi - } @@ -336,13 +335,15 @@ test_step_output_print() { done } -# Editor modelines # -# Local Variables: -# sh-basic-offset: 8 +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 # tab-width: 8 # indent-tabs-mode: t # End: # -# ex: set shiftwidth=8 tabstop=8 noexpandtab: +# vi: set shiftwidth=8 tabstop=8 noexpandtab: # :indentSize=8:tabSize=8:noTabs=false: +#