diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-01-05 00:29:32 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-01-05 00:29:32 +0000 |
commit | 8fcb1323e7b0d4bd950d8916cd134030397eda29 (patch) | |
tree | 24348ea56d2b9d007294ee330f3a624a22b3e505 /test/suite-clopts.sh | |
parent | e897f0a8054d711168fcf5c30739f2968613d4b6 (diff) |
interface index 0 is invalid (starting with 1), check if it's rejected correctly
svn path=/trunk/; revision=16946
Diffstat (limited to 'test/suite-clopts.sh')
-rw-r--r-- | test/suite-clopts.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh index 2c5833dd56..a090015c40 100644 --- a/test/suite-clopts.sh +++ b/test/suite-clopts.sh @@ -110,7 +110,7 @@ clopts_step_invalid_capfilter() { fi } -# check exit status and grep output string of an invalid capture filter +# check exit status and grep output string of an invalid interface clopts_step_invalid_interface() { $TETHEREAL -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1 RETURNVALUE=$? @@ -127,6 +127,24 @@ clopts_step_invalid_interface() { fi } +# check exit status and grep output string of an invalid interface index +# (valid interface indexes start with 1) +clopts_step_invalid_interface_index() { + $TETHEREAL -i 0 -w './testout.pcap' > ./testout.txt 2>&1 + RETURNVALUE=$? + if [ ! $RETURNVALUE -eq $EXIT_COMMAND_LINE ]; then + test_step_failed "exit status: $RETURNVALUE" + else + grep -i 'there is no interface with that adapter index' ./testout.txt > /dev/null + if [ $? -eq 0 ]; then + test_step_ok + else + cat ./testout.txt + test_step_failed "Infos" + fi + fi +} + # check exit status and grep output string of an invalid capture filter # XXX - how to efficiently test the *invalid* flags? clopts_step_valid_name_resolving() { @@ -157,6 +175,7 @@ clopt_suite() { test_suite_add "Valid Tethereal single char options" clopts_suite_valid_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_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" |