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"
+
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
}
-# check exit status when reading a none existing file
+# check exit status when reading a non-existing file
clopts_step_nonexisting_file() {
$TSHARK -r ThisFileDontExist.pcap > ./testout.txt 2>&1
RETURNVALUE=$?
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
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
if [ $? -eq 0 ]; then
test_step_ok
else
- cat ./testout.txt
+ test_step_output_print ./testout.txt
test_step_failed "Infos"
fi
fi
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() {
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: