Add some debug info to help in diagnosing buildbot 'run tests' failures
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 23 Feb 2008 21:19:44 +0000 (21:19 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 23 Feb 2008 21:19:44 +0000 (21:19 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24447 f5534014-38df-0310-8fa8-9805f1628bb7

test/config.sh
test/suite-clopts.sh
test/test-backend.sh

index 7f81d784f47fa14e5bcfccc8ec0346817e63c2b6..369ace8d11afeaade8b01adcd0a1a886c18e862c 100755 (executable)
@@ -79,3 +79,12 @@ if [ "$WS_SYSTEM" != "Windows" ] && which mkfifo &>/dev/null ; then
     TEST_FIFO=1
 fi
 
+# Display our environment
+
+printf "\n ------- Info =-----------------\n"
+printf "Syms :$WS_SYSTEM: :$TRAFFIC_CAPTURE_IFACE: :$SKIP_CAPTURE: :$TEST_FIFO:\n"
+
+ls -l $WIRESHARK $TSHARK $DUMPCAP
+ls -l $(which wireshark) $(which tshark) $(which dumpcap)
+printf " ----------------------------------\n\n"
+
index 6c751d0ff803d595b389827f8e21de2ea967fe63..ad691acd97615d6a1b244c1424d6847b04b75b17 100755 (executable)
@@ -28,7 +28,6 @@ EXIT_OK=0
 EXIT_COMMAND_LINE=1
 EXIT_ERROR=2
 
-
 # generic: check against a specific exit status with a single char option
 # $1 command: tshark
 # $2 option: a
@@ -60,7 +59,7 @@ clopts_step_existing_file() {
 }
 
 
-# check exit status when reading a nonexisting file
+# check exit status when reading a non-existing file
 clopts_step_nonexisting_file() {
        $TSHARK -r ThisFileDontExist.pcap  > ./testout.txt 2>&1
        RETURNVALUE=$?
@@ -119,9 +118,10 @@ clopts_step_invalid_capfilter() {
        else
                grep -i 'Invalid capture filter: "jkghg"' ./testout.txt > /dev/null
                if [ $? -eq 0 ]; then
+                       test_step_output_print ./testout.txt
                        test_step_ok
                else
-                       cat ./testout.txt
+                       test_step_output_print ./testout.txt
                        test_step_failed "Infos"
                fi
        fi
@@ -136,9 +136,10 @@ clopts_step_invalid_interface() {
        else
                grep -i 'The capture session could not be initiated' ./testout.txt > /dev/null
                if [ $? -eq 0 ]; then
+                       test_step_output_print ./testout.txt
                        test_step_ok
                else
-                       cat ./testout.txt
+                       test_step_output_print ./testout.txt
                        test_step_failed "Infos"
                fi
        fi
@@ -156,7 +157,7 @@ clopts_step_invalid_interface_index() {
                if [ $? -eq 0 ]; then
                        test_step_ok
                else
-                       cat ./testout.txt
+                       test_step_output_print ./testout.txt
                        test_step_failed "Infos"
                fi
        fi
@@ -185,9 +186,14 @@ clopts_suite_basic() {
        test_step_add "Exit status for none existing files must be 2" clopts_step_nonexisting_file
 }
 
+clopts_suite_capture_options() {
+       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
+}
 
 clopts_post_step() {
-       rm -f ./testout.txt
+       rm -f ./testout.txt ./testout2.txt
 }
 
 clopt_suite() {
@@ -196,11 +202,15 @@ clopt_suite() {
        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_suite_add "Interface-specific TShark single char options" clopts_suite_interface_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
+       test_suite_add "Capture filter/interface options tests" clopts_suite_capture_options
        test_step_add  "Valid name resolution options -N (1s)" clopts_step_valid_name_resolving
        #test_remark_add "Undocumented command line option: G"
        #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:
index 49762a724d91cc0e9bd4d53c2be7945e73986b10..324a49d1534d8f30a0ce1d28cf54e8ac2ca56659 100755 (executable)
@@ -322,3 +322,23 @@ test_step_skipped() {
        $color_reset
 }
 
+test_step_output_print() {
+       wait
+       printf "\n"
+       for f in "$@"; do
+               if [[ -f "$f" ]]; then
+                       printf " --> $f\n"
+                       cat "$f"
+                       printf " <--\n"
+               else
+                       printf " --> $f: doesn't exist (or isn't a file)\n"
+               fi
+       done
+}
+
+## Emacs
+## Local Variables:
+## tab-width: 8
+## indent-tabs-mode: t
+## sh-basic-offset: 8
+## End: