mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 23:28:13 +00:00
Extend ssl-opt.h so that run_test takes function
Extend the run_test function in ssl-opt.sh so that it accepts the -f and -F options. These parameters take an argument which is the name of a shell function that will be called by run_test and will be given the client input and output debug log. The idea is that these functions are defined by each test and they can be used to do some custom check beyon those allowed by the pattern matching capabilities of the run_test function.
This commit is contained in:
parent
6bce9cb5ac
commit
93993defd1
1 changed files with 14 additions and 0 deletions
|
@ -357,9 +357,11 @@ detect_dtls() {
|
|||
# Options: -s pattern pattern that must be present in server output
|
||||
# -c pattern pattern that must be present in client output
|
||||
# -u pattern lines after pattern must be unique in client output
|
||||
# -f call shell function on client output
|
||||
# -S pattern pattern that must be absent in server output
|
||||
# -C pattern pattern that must be absent in client output
|
||||
# -U pattern lines after pattern must be unique in server output
|
||||
# -F call shell function on server output
|
||||
run_test() {
|
||||
NAME="$1"
|
||||
shift 1
|
||||
|
@ -546,6 +548,18 @@ run_test() {
|
|||
return
|
||||
fi
|
||||
;;
|
||||
"-F")
|
||||
if ! $2 "$SRV_OUT"; then
|
||||
fail "function call to '$2' failed on Server output"
|
||||
return
|
||||
fi
|
||||
;;
|
||||
"-f")
|
||||
if ! $2 "$CLI_OUT"; then
|
||||
fail "function call to '$2' failed on Client output"
|
||||
return
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown test: $1" >&2
|
||||
|
|
Loading…
Reference in a new issue