summaryrefslogtreecommitdiffstats
path: root/reg-tests/stats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:11 +0000
commit669c3ea68099b330943d5c3215f0cf381880c3ad (patch)
treeb5fbb97171c91fb994c2c3744dd33073f8f07407 /reg-tests/stats
parentReleasing progress-linux version 2.9.7-1~progress7.99u1. (diff)
downloadhaproxy-669c3ea68099b330943d5c3215f0cf381880c3ad.tar.xz
haproxy-669c3ea68099b330943d5c3215f0cf381880c3ad.zip
Merging upstream version 3.0.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'reg-tests/stats')
-rw-r--r--reg-tests/stats/sample-stats-file26
-rw-r--r--reg-tests/stats/stats-file.vtc35
2 files changed, 61 insertions, 0 deletions
diff --git a/reg-tests/stats/sample-stats-file b/reg-tests/stats/sample-stats-file
new file mode 100644
index 0000000..4748579
--- /dev/null
+++ b/reg-tests/stats/sample-stats-file
@@ -0,0 +1,26 @@
+#fe guid,stot,
+
+// valid line
+guid-fe,1024,
+
+// invalid non numerical value must be silently ignored
+guid-fe,abc,
+
+// listener counters not allocated if no option socket-stats
+guid-feS-0,1024
+guid-fe2S-0,1024
+
+// unknown GUID must be silently ignored
+guid-unknown,1024,
+
+// invalid GUID side must be silently ignored
+guid-be,1024
+
+// unknown section line must be silently ignored
+#inval guid,other,
+guid-foo,0,0,
+
+// valid lines
+#be guid,unknown,stot,
+guid-be,512,1024,
+guid-srv,512,1024,
diff --git a/reg-tests/stats/stats-file.vtc b/reg-tests/stats/stats-file.vtc
new file mode 100644
index 0000000..d7c501a
--- /dev/null
+++ b/reg-tests/stats/stats-file.vtc
@@ -0,0 +1,35 @@
+varnishtest "Preload counters via stats-file"
+
+feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(3.0-dev9)'"
+feature ignore_unknown_macro
+
+haproxy h1 -conf {
+ global
+ stats-file ${testdir}/sample-stats-file
+
+ frontend fe
+ guid guid-fe
+ bind "fd@${feS}" guid-prefix guid-feS
+
+ frontend fe2
+ guid guid-fe2
+ option socket-stats
+ bind "fd@${fe2S}" guid-prefix guid-fe2S
+
+ backend be
+ guid guid-be
+ server srv ${s1_addr}:${s1_port} guid guid-srv
+} -start
+
+haproxy h1 -cli {
+ send "show stat fe 15 -1 typed"
+ expect ~ "F.*.*.*.stot.1:MCP:u64:1024"
+
+ send "show stat fe2 15 -1 typed"
+ expect ~ "L.*.*.*.stot.1:MCP:u64:1024"
+
+ send "show stat be 15 -1 typed"
+ expect ~ "B.*.*.*.stot.1:MCP:u64:1024"
+ send "show stat be 15 -1 typed"
+ expect ~ "S.*.*.*.stot.1:MCP:u64:1024"
+}