mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 11:45:39 +01:00
Make mbedtls_ssl_get_bytes_avail tests more independent
Don't depend on the default sizes in the test programs: pass explicit request and buffer sizes. Don't depend on MAX_CONTENT_LEN (other than it not being extremely small: this commit assumes that it will never be less than 101). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
a30439a7f9
commit
5a1b3bdc44
@ -6411,18 +6411,31 @@ run_test "ClientHello without extensions" \
|
||||
|
||||
# Tests for mbedtls_ssl_get_bytes_avail()
|
||||
|
||||
# The server first reads buffer_size-1 bytes, then reads the remainder.
|
||||
run_test "mbedtls_ssl_get_bytes_avail: no extra data" \
|
||||
"$P_SRV" \
|
||||
"$P_SRV buffer_size=100" \
|
||||
"$P_CLI request_size=100" \
|
||||
0 \
|
||||
-s "Read from client: 100 bytes read$"
|
||||
|
||||
requires_max_content_len 474
|
||||
run_test "mbedtls_ssl_get_bytes_avail: extra data" \
|
||||
"$P_SRV" \
|
||||
"$P_CLI request_size=450" \
|
||||
run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \
|
||||
"$P_SRV buffer_size=100" \
|
||||
"$P_CLI request_size=101" \
|
||||
0 \
|
||||
-s "Read from client: 450 bytes read (.*+.*)"
|
||||
-s "Read from client: 101 bytes read (100 + 1)"
|
||||
|
||||
requires_max_content_len 200
|
||||
run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \
|
||||
"$P_SRV buffer_size=100" \
|
||||
"$P_CLI request_size=200" \
|
||||
0 \
|
||||
-s "Read from client: 200 bytes read (100 + 100)"
|
||||
|
||||
run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \
|
||||
"$P_SRV buffer_size=100" \
|
||||
"$P_CLI request_size=$MAX_CONTENT_LEN" \
|
||||
0 \
|
||||
-s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))"
|
||||
|
||||
# Tests for small client packets
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user