Fix the location of dhcp.pcap.
svn path=/trunk/; revision=41857
This commit is contained in:
parent
3a20e10615
commit
005e724d27
|
@ -168,7 +168,7 @@ capture_step_10packets_stdout() {
|
|||
# capture packets via a fifo
|
||||
capture_step_fifo() {
|
||||
mkfifo 'fifo'
|
||||
(cat $CAPFILE; sleep 1; tail -c +25 $CAPFILE) > fifo &
|
||||
(cat "${CAPTURE_DIR}dhcp.pcap"; sleep 1; tail -c +25 "${CAPTURE_DIR}dhcp.pcap") > fifo &
|
||||
$DUT -i fifo $TRAFFIC_CAPTURE_PROMISC \
|
||||
-w ./testout.pcap \
|
||||
-a duration:$TRAFFIC_CAPTURE_DURATION \
|
||||
|
@ -201,7 +201,7 @@ capture_step_fifo() {
|
|||
|
||||
# capture packets via a fifo
|
||||
capture_step_stdin() {
|
||||
(cat $CAPFILE; sleep 1; tail -c +25 $CAPFILE) | \
|
||||
(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 \
|
||||
|
|
|
@ -48,7 +48,7 @@ test_single_char_options()
|
|||
|
||||
# check exit status when reading an existing file
|
||||
clopts_step_existing_file() {
|
||||
$TSHARK -r $CAPFILE > ./testout.txt 2>&1
|
||||
$TSHARK -r "${CAPTURE_DIR}dhcp.pcap" > ./testout.txt 2>&1
|
||||
RETURNVALUE=$?
|
||||
if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
|
||||
test_step_failed "exit status: $RETURNVALUE"
|
||||
|
@ -182,7 +182,7 @@ clopts_step_valid_name_resolving() {
|
|||
|
||||
# check exit status of some basic functions
|
||||
clopts_suite_basic() {
|
||||
test_step_add "Exit status for existing file: \""$CAPFILE"\" must be 0" clopts_step_existing_file
|
||||
test_step_add "Exit status for existing file: \"""${CAPTURE_DIR}dhcp.pcap""\" must be 0" clopts_step_existing_file
|
||||
test_step_add "Exit status for none existing files must be 2" clopts_step_nonexisting_file
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# common exit status values
|
||||
|
@ -32,7 +32,7 @@ EXIT_ERROR=2
|
|||
|
||||
# input of file
|
||||
io_step_input_file() {
|
||||
$DUT -r dhcp.pcap -w ./testout.pcap > ./testout.txt 2>&1
|
||||
$DUT -r "${CAPTURE_DIR}dhcp.pcap" -w ./testout.pcap > ./testout.txt 2>&1
|
||||
RETURNVALUE=$?
|
||||
if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
|
||||
test_step_failed "exit status of $DUT: $RETURNVALUE"
|
||||
|
@ -47,7 +47,7 @@ io_step_input_file() {
|
|||
test_step_failed "No output file!"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
# ok, we got a capture file, does it contain exactly 10 packets?
|
||||
$CAPINFOS ./testout.pcap > ./testout.txt
|
||||
grep -Ei 'Number of packets:[[:blank:]]+4' ./testout.txt > /dev/null
|
||||
|
@ -63,9 +63,9 @@ io_step_input_file() {
|
|||
fi
|
||||
}
|
||||
|
||||
# piping input file to stdout using "-w -"
|
||||
# piping input file to stdout using "-w -"
|
||||
io_step_output_piping() {
|
||||
$DUT -r dhcp.pcap -w - > ./testout.pcap 2>./testout.txt
|
||||
$DUT -r "${CAPTURE_DIR}dhcp.pcap" -w - > ./testout.pcap 2>./testout.txt
|
||||
RETURNVALUE=$?
|
||||
if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
|
||||
test_step_failed "exit status of $DUT: $RETURNVALUE"
|
||||
|
@ -78,7 +78,7 @@ io_step_output_piping() {
|
|||
test_step_failed "No output file!"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
# ok, we got a capture file, does it contain exactly 10 packets?
|
||||
$CAPINFOS ./testout.pcap > ./testout2.txt 2>&1
|
||||
grep -Ei 'Number of packets:[[:blank:]]+4' ./testout2.txt > /dev/null
|
||||
|
@ -93,9 +93,9 @@ io_step_output_piping() {
|
|||
fi
|
||||
}
|
||||
|
||||
# piping input file to stdout using "-w -"
|
||||
# piping input file to stdout using "-w -"
|
||||
io_step_input_piping() {
|
||||
cat -B dhcp.pcap | $DUT -r - -w ./testout.pcap 2>./testout.txt
|
||||
cat -B "${CAPTURE_DIR}dhcp.pcap" | $DUT -r - -w ./testout.pcap 2>./testout.txt
|
||||
RETURNVALUE=$?
|
||||
if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
|
||||
$TSHARK -D
|
||||
|
@ -110,7 +110,7 @@ io_step_input_piping() {
|
|||
test_step_failed "No output file!"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
# ok, we got a capture file, does it contain exactly 10 packets?
|
||||
$CAPINFOS ./testout.pcap > ./testout2.txt 2>&1
|
||||
grep -Ei 'Number of packets:[[:blank:]]+4' ./testout2.txt > /dev/null
|
||||
|
@ -141,7 +141,7 @@ tshark_io_suite() {
|
|||
dumpcap_io_suite() {
|
||||
#DUT="$DUMPCAP -Q"
|
||||
DUT=$DUMPCAP
|
||||
|
||||
|
||||
test_step_add "Input file" io_step_input_file
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#
|
||||
|
||||
# an existing capture file
|
||||
CAPFILE=./dhcp.pcap
|
||||
USE_COLOR=1
|
||||
RUN_SUITE=""
|
||||
PRINT_USAGE=0
|
||||
|
|
Loading…
Reference in New Issue