]> git.ipfire.org Git - thirdparty/squid.git/commit
Support "negative" squid-conf-tests (#1214)
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 20 Dec 2022 15:41:40 +0000 (15:41 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 21 Dec 2022 22:35:16 +0000 (22:35 +0000)
commit12cac459b014c63fde919cccd3d35b88d1cf010d
treeb9fc4d0f83d3502d1e912fc56ba0f105b52b0b61
parent09835feb258c3058d028918e36d959dccb3f7496
Support "negative" squid-conf-tests (#1214)

The test suite can now check that Squid rejects a given malformed
configuration file and that the rejection reason matches the expected
one. The latter reduces the probability that a successful "negative"
test outcome would hide a bug (because Squid has rejected a malformed
file but for a reason unrelated to what the test was trying to verify).

For now, enable just one acl regex test case, addressing an old TODO.

To improve "negative" test coverage, we would need to generate test
configurations using a configuration template and a list of problematic
expressions (with corresponding failure messages), but this hard-coded
approach is already better than nothing.
test-suite/Makefile.am
test-suite/squidconf/bad-regex.conf [new file with mode: 0644]
test-suite/squidconf/bad-regex.conf.instructions [new file with mode: 0644]
test-suite/squidconf/regex.conf
test-suite/test-squid-conf.sh