[master] f5c7d24f4 vtc: New stream.peer_window variable for h2 checks
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Tue Jan 31 11:47:07 UTC 2023
commit f5c7d24f4a2c2524abaf2c8ad84f0eae7d7ca73c
Author: Walid Boudebouda <walid.boudebouda at gmail.com>
Date: Tue Jan 31 11:21:31 2023 +0100
vtc: New stream.peer_window variable for h2 checks
Closes #3681
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
diff --git a/bin/varnishtest/tests/a02006.vtc b/bin/varnishtest/tests/a02006.vtc
index e6ee7d451..ecb49745f 100644
--- a/bin/varnishtest/tests/a02006.vtc
+++ b/bin/varnishtest/tests/a02006.vtc
@@ -8,8 +8,20 @@ server s1 {
txcont -hdr "baz" "qux"
txdata -data "foo"
txdata -data "bar"
+ expect stream.peer_window == 65529
+ rxreq
+ txresp -bodylen 529
+ expect stream.peer_window == 65000
+ rxwinup
+ expect stream.peer_window == 65200
+ } -run
+ stream 0 {
+ expect stream.peer_window == 65000
+ rxwinup
+ expect stream.peer_window == 66000
} -run
+
} -start
client c1 -connect ${s1_sock} {
@@ -35,6 +47,15 @@ client c1 -connect ${s1_sock} {
stream 0 {
expect stream.window == 65529
} -run
+ stream 2 {
+ txreq
+ rxresp
+ txwinup -size 200
+ } -run
+ stream 0 {
+ txwinup -size 1000
+ } -run
+
} -run
server s1 -wait
diff --git a/bin/varnishtest/tests/a02010.vtc b/bin/varnishtest/tests/a02010.vtc
index adf12d33e..2e77c4d2d 100644
--- a/bin/varnishtest/tests/a02010.vtc
+++ b/bin/varnishtest/tests/a02010.vtc
@@ -2,17 +2,23 @@ varnishtest "Verify the initial window size"
server s1 {
stream 0 {
+ expect stream.peer_window == 65535
rxsettings
txsettings -ack
} -run
stream 1 {
+ expect stream.peer_window == 128
rxreq
txresp -bodylen 100
+ expect stream.peer_window == 28
} -run
stream 0 {
rxsettings
txsettings -ack
} -run
+ stream 1 {
+ expect stream.peer_window == -36
+ } -run
} -start
client c1 -connect ${s1_sock} {
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index a3470282e..cc93e550e 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -1124,7 +1124,11 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf)
/* SECTION: stream.spec.zexpect.zstream Stream
*
* stream.window
- * The current window size of the stream, or, if on stream 0,
+ * The current local window size of the stream, or, if on stream 0,
+ * of the connection.
+ *
+ * stream.peer_window
+ * The current peer window size of the stream, or, if on stream 0,
* of the connection.
*
* stream.weight
@@ -1138,6 +1142,11 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf)
(intmax_t)(s->id ? s->win_self : s->hp->h2_win_self->size));
return (buf);
}
+ if (!strcmp(spec, "stream.peer_window")) {
+ snprintf(buf, 20, "%jd",
+ (intmax_t)(s->id ? s->win_peer : s->hp->h2_win_peer->size));
+ return (buf);
+ }
if (!strcmp(spec, "stream.weight")) {
if (s->id) {
snprintf(buf, 20, "%d", s->weight);
More information about the varnish-commit
mailing list