blob: ef721fdff70e92bd4aabdeb07876a9baafdc5e6f [file] [log] [blame]
Frédéric Lécaille617d4f52019-01-11 10:10:22 +01001 * Regression testing for HAProxy with VTest *
Frédéric Lécaille4891e402018-06-19 14:06:07 +02002
3
Frédéric Lécaille617d4f52019-01-11 10:10:22 +01004This little README file is about how to compile and run vtest test case files (VTC files)
5to test HAProxy for any regression.
Frédéric Lécaille4891e402018-06-19 14:06:07 +02006
Frédéric Lécaille617d4f52019-01-11 10:10:22 +01007To do so, you will have to compile vtest program sources which depends on
8Varnish cache application sources. vtest, formerly varnishtest, is a very useful
9program which has been developed to test Varnish cache application. vtest has been
10modified in collaboration with Varnish cache conceptor Poul-Henning Kamp to support
11HAProxy in addition to Varnish cache.
Frédéric Lécaille4891e402018-06-19 14:06:07 +020012
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010013See also: doc/regression-testing.txt
Frédéric Lécaille4891e402018-06-19 14:06:07 +020014
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010015* vtest compilation *
Frédéric Lécaille4891e402018-06-19 14:06:07 +020016
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010017 $ git clone https://github.com/vtest/VTest
Frédéric Lécaille4891e402018-06-19 14:06:07 +020018
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010019 $ cd VTest
Frédéric Lécaille4891e402018-06-19 14:06:07 +020020
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010021 $ make vtest
Frédéric Lécaille4891e402018-06-19 14:06:07 +020022
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010023 Then vtest program may be found at the root directory of vtest sources directory.
24 The Varnish cache manuals are located in 'man' directory of Varnish cache sources
25 directory. You will have to have a look at varnishtest(7) and vtc(7) manuals to
26 use vtest.
Frédéric Lécaille4891e402018-06-19 14:06:07 +020027
28 Some information may also be found in doc/regression-testing.txt in HAProxy
29 sources.
30
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010031 Note that VTC files for Varnish cache may be found in bin/varnishtest/tests directory
32 of Varnish cache sources directory which may be found here:
33 https://github.com/varnishcache/varnish-cache
34
Frédéric Lécaille4891e402018-06-19 14:06:07 +020035
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010036* vtest execution *
Frédéric Lécaille4891e402018-06-19 14:06:07 +020037
38 You must set HAPROXY_PROGRAM environment variable to give the location
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010039 of the HAProxy program to test to vtest:
Frédéric Lécaille4891e402018-06-19 14:06:07 +020040
Tim Duesterhusa9334df2021-05-31 23:07:29 +020041 $ HAPROXY_PROGRAM=<my haproxy program> vtest ...
Frédéric Lécaille4891e402018-06-19 14:06:07 +020042
43 The HAProxy VTC files found in HAProxy sources may be run with the reg-tests
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010044 Makefile target. You must set the VTEST_PROGRAM environment variable to
45 give the location of the vtest program which has been previously compiled.
Frédéric Lécaille4891e402018-06-19 14:06:07 +020046
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010047 $ VTEST_PROGRAM=<my vtest program> make reg-tests
Frédéric Lécaille4891e402018-06-19 14:06:07 +020048
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010049 "reg-tests" Makefile target run scripts/run-regtest.sh script.
50 To get more information about this script run it with --help option.
51
52 Note that vtest is run with -t10 and -l option. -l option is to keep
53 keep vtest temporary directory in case of failed test cases. core files
Frédéric Lécaille4891e402018-06-19 14:06:07 +020054 may be found in this directory (if enabled by ulimit).
55
56
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010057* vtest patches for HAProxy VTC files *
Frédéric Lécaille4891e402018-06-19 14:06:07 +020058
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010059 When producing a patch to add a VTC regression testing file to reg-tests directory,
Frédéric Lécaille4891e402018-06-19 14:06:07 +020060 please follow these simple rules:
61
Frédéric Lécaille617d4f52019-01-11 10:10:22 +010062 - If your VTC file needs others files, if possible, use the same basename as that
63 of the VTC file,
Frédéric Lécaille4891e402018-06-19 14:06:07 +020064 - Put these files in a directory with the same name as the code area concerned
65 by the bug ('peers', 'lua', 'acl' etc).
Willy Tarreauf6739232021-11-18 17:46:22 +010066
67Please note that most tests use a common set of timeouts defined by the
68environment variable HAPROXY_TEST_TIMEOUT. As much as possible, for regular I/O
69(i.e. not errors), please try to reuse that setting so that the value may
70easily be adjusted when running in some particularly slow environments, or be
71shortened to fail faster on developers' machines.