Move SKIP_CAPTURE from suite-capture.sh to config.sh so that we can use it
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 8 Nov 2007 16:59:30 +0000 (16:59 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 8 Nov 2007 16:59:30 +0000 (16:59 +0000)
in suite-clopts as well.  Allow it to be set externally.  This should fix
the "test" failure in the Solairs builder.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23399 f5534014-38df-0310-8fa8-9805f1628bb7

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

index acc107257b6bf89fcb31ca837f7937dc32353fc3..7f81d784f47fa14e5bcfccc8ec0346817e63c2b6 100755 (executable)
@@ -31,11 +31,17 @@ else
        WS_SYSTEM=`uname -s`
 fi
 
-# path to the Wireshark binaries, only used for the settings below
+
+# Path to the Wireshark binaries, only used for the settings below
+WS_BIN_PATH=..
+
+# Are we allowed to open interfaces or capture on this system?
+SKIP_CAPTURE=${SKIP_CAPTURE:-1}
+
+# Override the last two items if we're running Windows
 if [ "$WS_SYSTEM" = "Windows" ] ; then
        WS_BIN_PATH=../wireshark-gtk2
-else
-       WS_BIN_PATH=..
+       SKIP_CAPTURE=0
 fi
 
 # Tweak the following to your liking.
@@ -64,11 +70,11 @@ TRAFFIC_CAPTURE_DURATION=60
 # if you need promiscuous mode, comment this line out
 TRAFFIC_CAPTURE_PROMISC=-p
 
-# only test capturing from a fifo if we're not on Windows 
-#  and we have a mkfifo. (Windows cygwin has a mkfifo but 
-#   Windows dumpcap & etc use Windows named pipes which 
-#   are different than the cygwin named pipes). 
-#  
+# only test capturing from a fifo if we're not on Windows
+#  and we have a mkfifo. (Windows cygwin has a mkfifo but
+#   Windows dumpcap & etc use Windows named pipes which
+#   are different than the cygwin named pipes).
+#
 if [ "$WS_SYSTEM" != "Windows" ] && which mkfifo &>/dev/null ; then
     TEST_FIFO=1
 fi
index 0a310a595e844561bd2530469e7c4a35c8c6ca40..12ed91684f04081e18c12e8662253d1cbd04d97f 100755 (executable)
@@ -29,11 +29,6 @@ EXIT_OK=0
 EXIT_COMMAND_LINE=1
 EXIT_ERROR=2
 
-case $WS_SYSTEM in
-       Windows|SunOS) SKIP_CAPTURE=0 ;;
-       *) SKIP_CAPTURE=1 ;;
-esac
-
 capture_test_output_print() {
        wait
        for f in "$@"; do
@@ -49,7 +44,7 @@ traffic_gen_ping() {
        # Generate some traffic for quiet networks.
        # This will have to be adjusted for non-Windows systems.
        {
-       date 
+       date
        for (( x=20; x<=50; x++ )) # in effect: number the packets
        do
                # How does ping _not_ have a standard set of arguments?
index d1b37dfc0a48ea1ba83786b01b195fd8a10509d1..6c751d0ff803d595b389827f8e21de2ea967fe63 100755 (executable)
@@ -95,7 +95,7 @@ clopts_suite_valid_chars() {
 clopts_suite_interface_chars() {
        for index in D L
        do
-          if [ "$WS_SYSTEM" = "Windows" ] ; then
+          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"