diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-08-10 19:04:40 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-08-22 12:31:46 +0200 |
commit | b7278eea441cb70debfbbba350026e58ad41cb83 (patch) | |
tree | af70124e9850fdc1ede424ff2f7419d713ccf87b | |
parent | b6125b54ededb83ca930174718157d73561523ad (diff) |
Update the ssltraceref.txt
Also adds saving the new trace to ssltraceref-new.txt in
test-runs which can be handy when the trace changes and
needs to be updated.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21713)
-rw-r--r-- | test/quicapitest.c | 16 | ||||
-rw-r--r-- | test/recipes/75-test_quicapi_data/ssltraceref.txt | 16 |
2 files changed, 31 insertions, 1 deletions
diff --git a/test/quicapitest.c b/test/quicapitest.c index 2e1e8900be..d17d704d29 100644 --- a/test/quicapitest.c +++ b/test/quicapitest.c @@ -374,7 +374,7 @@ static void strip_line_ends(char *str) static int compare_with_file(BIO *membio) { - BIO *file = NULL; + BIO *file = NULL, *newfile = NULL; char buf1[512], buf2[512]; char *reffile; int ret = 0; @@ -388,6 +388,19 @@ static int compare_with_file(BIO *membio) if (!TEST_ptr(file)) goto err; + newfile = BIO_new_file("ssltraceref-new.txt", "wb"); + if (!TEST_ptr(newfile)) + goto err; + + while (BIO_gets(membio, buf2, sizeof(buf2)) > 0) + if (BIO_puts(newfile, buf2) <= 0) { + TEST_error("Failed writing new file data"); + goto err; + } + + if (!TEST_int_ge(BIO_seek(membio, 0), 0)) + goto err; + while (BIO_gets(file, buf1, sizeof(buf1)) > 0) { if (BIO_gets(membio, buf2, sizeof(buf2)) <= 0) { TEST_error("Failed reading mem data"); @@ -417,6 +430,7 @@ static int compare_with_file(BIO *membio) err: OPENSSL_free(reffile); BIO_free(file); + BIO_free(newfile); return ret; } diff --git a/test/recipes/75-test_quicapi_data/ssltraceref.txt b/test/recipes/75-test_quicapi_data/ssltraceref.txt index bbb0ae6b3b..f9e619adfa 100644 --- a/test/recipes/75-test_quicapi_data/ssltraceref.txt +++ b/test/recipes/75-test_quicapi_data/ssltraceref.txt @@ -233,6 +233,22 @@ YeeuLO02zToHhnQ6KbPXOrQAqcL1kngO4g+j/ru+4AZThFkdkGnltvk= ------------------ No extensions +Sent Frame: Ack (without ECN) + Largest acked: 0 + Ack delay (raw) 0 + Ack range count: 0 + First ack range: 0 +Sent Frame: Padding +Sent Packet + Packet Type: Initial + Version: 0x00000001 + Destination Conn Id: 0x???????????????? + Source Conn Id: <zero length id> + Payload length: 1178 + Token: <zerlo length token> + Packet Number: 0x00000001 +Sent Datagram + Length: 1200 Received Datagram Length: 234 Received Packet |