]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
TESTS: add config smoke checks in the unit tests
authorWilliam Lallemand <wlallemand@haproxy.com>
Sat, 1 Mar 2025 18:16:18 +0000 (19:16 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 3 Mar 2025 11:43:32 +0000 (12:43 +0100)
vtest.yml contains some config checks that are used to check the
memleaks.

This patch adds a unit test which runs the same tests.

tests/unit/smoke/test.sh [new file with mode: 0755]

diff --git a/tests/unit/smoke/test.sh b/tests/unit/smoke/test.sh
new file mode 100755 (executable)
index 0000000..5d221ad
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+check() {
+       ${HAPROXY_PROGRAM} -vv | grep CFLAGS | grep -q "fsanitize=address"
+}
+
+run() {
+       ${HAPROXY_PROGRAM} -dI -f ${ROOTDIR}/.github/h2spec.config -c
+       ${HAPROXY_PROGRAM} -dI -f ${ROOTDIR}/examples/content-sw-sample.cfg -c
+       ${HAPROXY_PROGRAM} -dI -f ${ROOTDIR}/examples/option-http_proxy.cfg -c
+       ${HAPROXY_PROGRAM} -dI -f ${ROOTDIR}/examples/quick-test.cfg -c
+       ${HAPROXY_PROGRAM} -dI -f ${ROOTDIR}/examples/transparent_proxy.cfg -c
+}
+
+case "$1" in
+       "check")
+               check
+       ;;
+       "run")
+               run
+       ;;
+esac