3 # Test various command line testable aspects of the Wireshark tools
7 # Wireshark - Network traffic analyzer
8 # By Gerald Combs <gerald@wireshark.org>
9 # Copyright 2005 Ulf Lamping
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 # an existing capture file
30 source test-backend.sh
33 source suite-clopts.sh
35 source suite-capture.sh
39 test_step_prerequisites() {
42 for i in "$ETHEREAL" "$TETHEREAL" "$CAPINFOS" "$DUMPCAP" ; do
44 echo "Couldn't find $i"
48 if [ $NOTFOUND -eq 1 ]; then
49 test_step_failed "Tool not found"
57 prerequisites_suite() {
58 test_step_add "Prerequisites settings" test_step_prerequisites
62 test_suite_add "Prerequisites" prerequisites_suite
63 test_suite_add "Command line options" clopt_suite
64 test_suite_add "File I/O" io_suite
65 test_suite_add "Capture" capture_suite
69 #test_set_output OFF # doesn't work
70 #test_set_output DOTTED
71 test_set_output VERBOSE
74 #test_suite_run "Tethereal command line options" clopt_suite
75 #test_suite_run "Tethereal capture" capture_suite
79 #test_suite_run "All" test_suite
80 #test_suite_show "All" test_suite
85 menu_function[0]=test_suite
87 echo "----------------------------------------------------------------------"
89 for ((a=0; a <= 100000000000 ; a++))
91 TEST_STEPS[0]=0 # number of steps of a specific nesting level
93 #echo $current_title $current_function
94 test_suite_show "${menu_title[MENU_LEVEL]}" "${menu_function[MENU_LEVEL]}"
95 echo "1-$TEST_STEPS : Select item"
96 echo "Enter: Test All"
97 if [[ ! $MENU_LEVEL -eq 0 ]]; then
104 echo "$newl----------------------------------------------------------------------"
106 TEST_STEPS[0]=0 # number of steps of a specific nesting level
115 for ((a=1; a <= LIMIT ; a++)) # Double parentheses, and "LIMIT" with no "$".
117 test_suite_run "${menu_title[MENU_LEVEL]}" "${menu_function[MENU_LEVEL]}"
119 echo "----------------------------------------------------------------------"
122 if [[ ! $MENU_LEVEL -eq 0 ]]; then
123 let "MENU_LEVEL -= 1"
124 #echo "----------------------------------------------------------------------"
128 let "MENU_LEVEL += 1"
129 menu_title[MENU_LEVEL]=${test_title[1]}
130 menu_function[MENU_LEVEL]=${test_function[1]}
133 let "MENU_LEVEL += 1"
134 menu_title[MENU_LEVEL]=${test_title[2]}
135 menu_function[MENU_LEVEL]=${test_function[2]}
138 let "MENU_LEVEL += 1"
139 menu_title[MENU_LEVEL]=${test_title[3]}
140 menu_function[MENU_LEVEL]=${test_function[3]}
143 let "MENU_LEVEL += 1"
144 menu_title[MENU_LEVEL]=${test_title[4]}
145 menu_function[MENU_LEVEL]=${test_function[4]}
148 let "MENU_LEVEL += 1"
149 menu_title[MENU_LEVEL]=${test_title[5]}
150 menu_function[MENU_LEVEL]=${test_function[5]}
153 let "MENU_LEVEL += 1"
154 menu_title[MENU_LEVEL]=${test_title[6]}
155 menu_function[MENU_LEVEL]=${test_function[6]}
158 let "MENU_LEVEL += 1"
159 menu_title[MENU_LEVEL]=${test_title[7]}
160 menu_function[MENU_LEVEL]=${test_function[7]}
163 let "MENU_LEVEL += 1"
164 menu_title[MENU_LEVEL]=${test_title[8]}
165 menu_function[MENU_LEVEL]=${test_function[8]}
168 let "MENU_LEVEL += 1"
169 menu_title[MENU_LEVEL]=${test_title[9]}
170 menu_function[MENU_LEVEL]=${test_function[9]}