aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest/config.sh9
-rwxr-xr-xtest/suite-clopts.sh28
-rwxr-xr-xtest/test-backend.sh20
3 files changed, 48 insertions, 9 deletions
diff --git a/test/config.sh b/test/config.sh
index 7f81d784f4..369ace8d11 100755
--- a/test/config.sh
+++ b/test/config.sh
@@ -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"
+
diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh
index 6c751d0ff8..ad691acd97 100755
--- a/test/suite-clopts.sh
+++ b/test/suite-clopts.sh
@@ -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 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=$?
@@ -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:
diff --git a/test/test-backend.sh b/test/test-backend.sh
index 49762a724d..324a49d153 100755
--- a/test/test-backend.sh
+++ b/test/test-backend.sh
@@ -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: