Commit Graph

94 Commits

Author SHA1 Message Date
Willy Tarreau
1bbc74b554 REGTEST: fix tls_health_checks random failures on MacOS in Travis-CI
Since commit 2eb1c79df ("REGTEST: make the tls_health_checks test much
faster") the build tests randomly fail on MacOS on Travis-CI. Each time
this test is reponsible for the failure, showing huge response times
possibly indicating that the VMs running the tests are sometimes
overloaded. Since this delay directly impacts the whole regtest execution
time everywhere, it's important not to inflate it too much. It was bumped
to 100ms instead of 40, that doesn't add significantly to the perceived
execution time and should be enough for Travis since test reports have
shown around 60-70 ms.
2019-05-13 10:47:41 +02:00
Frédéric Lécaille
5dfdd4a630 REGTEST: Wrong assumption in IP:port logging test.
In this reg test, as the client connection is not supposed to receive any
server response, we should try to "rxresp" but we should expect the client
connection to be closed by haproxy. This is done replacing "rxresp" by
"expect_close". Furthermore since dbb75ee3 vtest commit, calling "rxresp"
expects at least to receive a HTTP header as shown by Travis build
here: https://travis-ci.com/haproxy/haproxy/jobs/198126488.
2019-05-07 13:58:35 +02:00
Frédéric Lécaille
7eb936e688 REGTEST: Wrong renaming for one reg test.
Fix a wrong reg test file renaming which came with d7a8f14 commit
(REGTEST: rename the reg test files). This prevented
reg-tests/log/wrong_ip_port_logging.vtc with "bug" as reg test type
from being run.
2019-05-07 11:32:56 +02:00
Frédéric Lécaille
b138ad046d REGTEST: Reg tests file renaming.
Remove old s_ prefixes for some reg tests after they have been flagged
as slow by 91704bfa commit (REGTEST: Flag some slow reg tests).
2019-05-07 11:32:56 +02:00
Frédéric Lécaille
c8f931c87b REGTEST: Flag some slow reg tests.
All reg-tests/peers/*basic_sync*.vtc tests are slow reg reg tests.
2019-05-07 11:32:56 +02:00
Willy Tarreau
596ce52fe1 REGTEST: make the "table in peers" test require v2.0
And the second test also requires openssl otherwise it fails as seen
here : https://travis-ci.com/haproxy/haproxy/jobs/198126488
2019-05-07 07:53:54 +02:00
Willy Tarreau
2eb1c79df1 REGTEST: make the tls_health_checks test much faster
This test relies on a server timeout and was using the default 2s check
interval with a full 1s server timeout, thus adding a whole second to the
test series by itself. Let's shrink the server timeout to 20ms which is
way enough to properly trigger a timeout, and set the check interval to
the double of this, or 40ms.
2019-05-07 07:29:33 +02:00
Frédéric Lécaille
4d7894870a REGTEST: Add reg tests for "table" lines in "peers" sections.
These reg tests are there to test the support for stick-table declarations
in "peers" sections ("table" keyword).
2019-05-07 06:54:07 +02:00
Frédéric Lécaille
eacb022676 REGTEST: Make this reg test be Linux specific.
This patch reverts 9ffb88 commit (REGTEST: Be less Linux specific with a syslog
regex.) and makes this script be Linux specific.
2019-04-30 11:56:52 +02:00
Frédéric Lécaille
85a7ea0740 REGTEST: Add a new reg test for log load-balancing feature.
This is a reg test for the log load-balancing feature implemented by
these commits:
  MINOR: log: Add "sample" new keyword to "log" lines
  MINOR: log: Enable the log sampling and load-balancing feature

The size of the logging buffer for vtest has been doubled to support this script.
2019-04-30 09:25:09 +02:00
Willy Tarreau
084354f0be REGTEST: exclude OSX and generic targets from abns_socket.vtc
This one relies on Linux's abstract namespace sockets which are not
available there. FreeBSD used to already be excluded.
2019-04-25 08:50:25 +02:00
Willy Tarreau
4fd376d51d REGTEST: relax the IPv6 address format checks in converters_ipmask_concat_strcmp_field_word
In Travis build https://travis-ci.com/haproxy/haproxy/jobs/195477767 we
can see that OSX tends to pad zeroes at a different position than Linux
in compact IPv6 addresses, resulting in a failure in the checks which
were developped on Linux. This patch uses [0:]* in holes and [0:]+ at the
end of addresses to allow the different variants. It will unfortunately
also accept impossible addresses but there is no reason that we have to
care about for such crap to be emitted.
2019-04-25 08:47:15 +02:00
Willy Tarreau
03c6ab0cbb REGTEST: exclude osx and generic targets for 40be_2srv_odd_health_checks
As explained in the commit below, this test relies on TCP_DEFER_ACCEPT
which is not available everywhere, and as such fails on OSX as well :
15685c791 ("REGTEST: Exclude freebsd target for some reg tests.")
2019-04-25 08:39:48 +02:00
Frédéric Lécaille
b894f9230c REGTEST: adapt some reg tests after renaming.
Some reg tests and their dependencies have been renamed. They may be
referenced by the .vtc files. So, this patch modifies also the references
to these dependencies.
2019-04-23 15:37:11 +02:00
Frédéric Lécaille
d7a8f14145 REGTEST: rename the reg test files.
We rename all the VTC files to avoid name collisions when importing/backporting.
2019-04-23 15:37:03 +02:00
Frédéric Lécaille
dc1a3bd999 REGTEST: replace LEVEL option by a more human readable one.
This patch replaces LEVEL variable by REGTESTS_TYPES variable which is more
mnemonic and human readable. It is uses as a filter to run the reg tests scripts
where a commented #REGTEST_TYPE may be defined to designate their types.
Running the following command:

    $ REGTESTS_TYPES=slow,default

will start all the reg tests where REGTEST_TYPE is defines as 'slow' or 'default'.
Note that 'default' is also the default value of REGTEST_TYPE when not specified
dedicated to run all the current h*.vtc files. When REGTESTS_TYPES is not specified
there is no filter at all. All the tests are run.

This patches also defines REGTEST_TYPE with 'slow' value for all the s*.vtc files,
'bug' value for al the b*.vtc files, 'broken' value for all the k*.vtc files.
2019-04-23 15:14:52 +02:00
Frédéric Lécaille
ffe30f708f REGTEST: Missing REQUIRE_VERSION declarations.
checks/s00001.vtc needs support for "srvrecord" which came with 1.8 version.
peers/s_basic_sync.vtc and s_tls_basic_sync.vtc need support for "server"
keyword usage in "peers" section which came with 2.0 version.
2019-04-19 15:48:41 +02:00
Ilya Shipitsin
9ab3138d71 REGTESTS: exclude tests that require ssl, pcre if no such feature is enabled
Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
2019-04-17 11:01:58 +02:00
Christopher Faulet
ce4ec5039f REGTEST: lua/b00003: Specify the HAProxy pid when the command ss is executed
This avoids confusions with any other haproxy process.
2019-04-01 15:57:00 +02:00
Christopher Faulet
c423030dac REGTEST: lua/b00003: Relax the regex matching the log message
The timeer TR may be greater than 10ms, making the test fails.
2019-04-01 15:43:40 +02:00
Christopher Faulet
0dc100b4f2 REGTEST: log/b00000: Be sure the client always hits its timeout
To do so, the server does not send anything. Instead it waits 2ms before
closing. The client, on its side, will wait for a response. So it will be
blocked. Becauase the client timeout is set to 1ms, HAProxy should always close
the client connection because it times out.
2019-04-01 15:43:40 +02:00
Christopher Faulet
7057898f0f REGTEST: http-rules/h00003: Use a different client for requests expecting a 301
Because HAProxy may decide to close 301 responses, as others internal responses,
it is safer to use a different client for these requests. This is not the
purpose of this test to verify the keep-alive in such cases.
2019-04-01 15:43:40 +02:00
Christopher Faulet
f7b941c895 REGTEST: http-messaging/h00000: Fix the test when the HTX is enabled
The way unexpected bodies are handled for responses to HEAD requests differs from
the legacy HTTP to the HTX. While it is dropped wih the legacy HTTP, in HTX, it
is parsed as the response to the next request. So, in HTX, a 502 error is
returned to the client and the connexion is closed.

This test has been modified to pass in both mode.
2019-04-01 15:43:40 +02:00
Christopher Faulet
39581bb2de REGTEST: http-capture/h00000: Relax a regex matching the log message
Size reported in logs may differ between legacy HTTP and HTX, at least for
now. So in the regtest http-capture/h00000.vtc, we need to relax the regex
matching the log message.
2019-04-01 15:43:40 +02:00
Willy Tarreau
26ecceaadc REGTEST: remove unexpected "nbthread" statement from Lua test cases
Lua test files 2 and 3 fail when threads are disabled because of a
"nbthread" statement that seems to be a leftover from an ancient
configuration. One of them even mentions a commit message showing
a reproducer not involving threads. Let's clean this up so that
running the tests without threads also works.

This should be backported to 1.9 as the problem also exists there.
2019-03-27 14:15:33 +01:00
Frédéric Lécaille
b5c71d702e REGTEST: Enable again reg tests with HEAD HTTP method usage.
These reg tests have been disabled because they required a version of vtest
including a bug fix supposed to make these ones work without breaking others.
But reg-tests for compression were broken.

This issue has been fixed by 525ef0f vtest commit. So, to make all the
reg tests work you must update your vtest program to include 525ef0f commit.
(see https://github.com/vtest/VTest/commit/525ef0f for more information.
2019-03-26 11:54:05 +01:00
Willy Tarreau
99233164cd Revert "REGTEST: Enable reg tests with HEAD HTTP method usage."
This reverts commit 47e4e13c01.

It's a temporary revert. This commit suggested to update to vtest
commit 4e43cc1 to fix handling of HEAD requests, but the compression
was broken two commits before, leaving us with no single version of
vtest being able to run all tests anymore.

Let's temporary disable HEAD again in the tests so that we can use
any version up to and including a2e82a8 for the time it takes vtest
to fix the compression.
2019-03-15 15:07:12 +01:00
Frédéric Lécaille
47e4e13c01 REGTEST: Enable reg tests with HEAD HTTP method usage.
This patch enables the part of this reg test which could not work due to a vtest
(formerly varnishtest) bug.

NOTE: You must have a vtest version with 4e43cc1 commit for this bug fix to make this
script succeed (see 4e43cc1fec
for more information).
2019-03-06 16:14:59 +01:00
Frédéric Lécaille
3c4fb953ce REGTEST: Peers reg tests. 2019-03-06 15:36:02 +01:00
Willy Tarreau
8ae37d8a7b REGTEST: fix a spurious "nbthread 4" in the connection test
Commit 26f6ae12c ("MAJOR: config: disable support for nbproc and nbthread
in parallel") revealed that there was accidently nbproc+nbthread in this
test while nbproc is the one expected. This likely is a leftover from a
previous attempt at reproducing the issue.
2019-03-01 17:38:08 +01:00
Tim Duesterhus
b229f018ee BUG/MEDIUM: compression: Rewrite strong ETags
RFC 7232 section 2.3.3 states:

> Note: Content codings are a property of the representation data,
> so a strong entity-tag for a content-encoded representation has to
> be distinct from the entity tag of an unencoded representation to
> prevent potential conflicts during cache updates and range
> requests.  In contrast, transfer codings (Section 4 of [RFC7230])
> apply only during message transfer and do not result in distinct
> entity-tags.

Thus a strong ETag must be changed when compressing. Usually this is done
by converting it into a weak ETag, which represents a semantically, but not
byte-by-byte identical response. A conversion to a weak ETag still allows
If-None-Match to work.

This should be backported to 1.9 and might be backported to every supported
branch with compression.
2019-01-29 20:26:06 +01:00
Willy Tarreau
1915ca2738 BUG/MINOR: mux-h2: always compare content-length to the sum of DATA frames
This is mandated by RFC7541#8.1.2.6. Till now we didn't have a copy of
the content-length header field. But now that it's already parsed, it's
easy to add the check.

The reg-test was updated to match the new behaviour as the previous one
expected unadvertised data to be silently discarded.

This should be backported to 1.9 along with previous patch (MEDIUM: h2:
always parse and deduplicate the content-length header) after it has got
a bit more exposure.
2019-01-24 19:45:27 +01:00
PiBa-NL
b07e7b4dc1 REGTEST: checks basic stats webpage functionality
This regtest verifies that the stats webpage can be used to change a
server state to maintenance or drain, and that filtering the page scope
will result in a filtered page.
2019-01-17 11:32:12 +01:00
Frédéric Lécaille
617d4f5276 REGTEST: Adapt reg test doc files to vtest.
This is a first patch to switch from varnishtest to new standalone
varnish cache reg testing program: vtest.

More information may be found here:

https://github.com/vtest/VTest
https://varnish-cache.org/docs/trunk/reference/varnishtest.html
https://varnish-cache.org/docs/trunk/reference/vtc.html
2019-01-14 14:24:29 +01:00
Jarno Huuskonen
1261a87df9 DOC: REGTESTS README varnishtest -Dno-htx= define.
Add -Dno-htx= to varnishtest command line, because without no-htx most
vtc tests fail (${no-htx} macro). Also link to doc/regression-testing.txt
2019-01-14 10:52:28 +01:00
Jarno Huuskonen
3759fe76a7 REGTESTS: Basic tests for using maps to redirect requests / select backend 2019-01-14 10:52:28 +01:00
Jarno Huuskonen
3e5c772ebb REGTESTS: Basic tests for concat,strcmp,word,field,ipmask converters 2019-01-14 10:52:28 +01:00
Jarno Huuskonen
3f0f578286 REGTESTS: test case for map_regm commit 271022150d
Minimal test case for map_regm commit 271022150d.
Config and test is adapted from: Daniel Schneller's example
(https://www.mail-archive.com/haproxy@formilux.org/msg30523.html).
2019-01-14 10:52:28 +01:00
PiBa-NL
4dc3f3b4bb REGTEST: filters: add compression test
This test checks that data transferred with compression is correctly received at
different download speeds
2019-01-09 14:36:22 +01:00
Frédéric Lécaille
61ae5ca1f4 REGTEST: "capture (request|response)" regtest. 2019-01-09 10:06:10 +01:00
Frédéric Lécaille
0656d9ca75 REGTEST: Add a reg test for health-checks over SSL/TLS.
This script runs two tests. One with "httpchk" over SSL/TLS and another
one with "check-ssl" option. As varnishtest does not support SSL/TLS
we use two haproxy processes to run these tests. h2 haproxy process
be2 and be4 backends declare one server each wich are the frontend
of h1 haproxy process. We check the layer6/7 checks thanks to syslog
messages.

Signed-off-by: Frédéric Lécaille <flecaille@haproxy.com>
2019-01-08 10:10:18 +01:00
PiBa-NL
c3949d4c00 REGTEST: mailers: add new test for 'mailers' section
This test verifies the mailers section works properly by checking that
it sends the proper amount of mails when health-checks are changing and
or marking a server up/down

The test currently fails on all versions of haproxy i tried with varying
results:

- 1.9.0 produces thousands of mails.
- 1.8.14 only sends 1 mail, needs a 200ms 'timeout mail' to succeed
- 1.7.11 only sends 1 mail, needs a 200ms 'timeout mail' to succeed
- 1.6 only sends 1 mail, (does not have the 'timeout mail' setting implemented)
2019-01-08 10:03:52 +01:00
Willy Tarreau
9832a37b16 REGTESTS: remove the expected window updates from H2 handshakes
These ones are not needed anymore since commit 97aaa67 ("MINOR: mux-h2:
only increase the connection window with the first update"). The tests
should now be more reliable. It might be worth simply removing all the
explicit handshake though it doesn't hurt and still serves as documentation.
2018-12-23 09:58:41 +01:00
Frédéric Lécaille
02a16690d7 REGTEST: A basic test for "http-buffer-request" 2018-12-21 18:33:36 +01:00
Christopher Faulet
e98ce25b61 REGTEST: Add a basic test for the compression 2018-12-21 15:33:26 +01:00
Frédéric Lécaille
15685c7912 REGTEST: Exclude freebsd target for some reg tests.
This patch excludes freebsd target for health-checks reg tests
which rely on TCP_DEFER_ACCEPT usage. This is specific to Linux.
2018-12-20 11:00:17 +01:00
Frédéric Lécaille
a702947bef REGTEST: Missing enclosing quotes for ${tmpdir} macro. 2018-12-20 11:00:17 +01:00
Frédéric Lécaille
9ffb88d3cf REGTEST: Be less Linux specific with a syslog regex.
This patch makes at least this test pass on FreeBSD systems.
The regex to be matched with syslog message was too much Linux specific.
2018-12-20 11:00:17 +01:00
Frédéric Lécaille
3b3a883171 REGTEST: Fix a typo about barrier type.
Fix a typo, furthermore there is no reason to use a barrier with "sock" as type
which are more varnish cache specific: used to synchronize the VCL.
2018-12-20 11:00:17 +01:00
Christopher Faulet
8f16148df7 REGTEST: Add option to use HTX prefixed by the macro 'no-htx'
So some tests have been removed.
2018-12-20 10:37:32 +01:00