Re: [PATCH v7 2/3] t5551: make the test for extra HTTP headers more robust
- From
Jeff King <peff@peff.net>
- Date
- May 9, 2016, 08:05 UTC
- Message-ID
- <20160509080544.GB14383@sigill.intra.peff.net>
- In-Reply-To
- <f29dac327aeac23677aec955f5b46a7a4702abfe.1462774709.git.johannes.schindelin@gmx.de>
On Mon, May 09, 2016 at 08:19:00AM +0200, Johannes Schindelin wrote:
Show 9 quoted lines
> To test that extra HTTP headers are passed correctly, t5551 verifies that > a fetch succeeds when two required headers are passed, and that the fetch > does not succeed when those headers are not passed. > > However, this test would also succeed if the configuration required only > one header. As Apache's configuration is notoriously tricky (this > developer frequently requires StackOverflow's help to understand Apache's > documentation), especially when still supporting the 2.2 line, let's just > really make sure that the test verifies what we want it to verify.
Agreed, this makes sense.
Show 7 quoted lines
> test_expect_success 'custom http headers' ' > - test_must_fail git fetch "$HTTPD_URL/smart_headers/repo.git" && > + test_must_fail git -c http.extraheader="x-magic-two: cadabra" \ > + fetch "$HTTPD_URL/smart_headers/repo.git" && > git -c http.extraheader="x-magic-one: abra" \ > -c http.extraheader="x-magic-two: cadabra" \ > fetch "$HTTPD_URL/smart_headers/repo.git"
This loses the 0-header check, but I don't think that is particularly interesting to us (I had originally wanted to double-check that our apache config worked at all in the absence of this feature, but I think it is OK for the 1-header case to cover this; if our code is so buggy we accidentally send 0 headers in the first command, we'll catch that, too).
So looks good to me.
-Peff