git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http: fix v1 protocol tests with apache httpd < 2.4

From
Jeff King <peff@peff.net>
Date
Jan 3, 2018, 06:17 UTC
Message-ID
<20180103061703.GB25752@sigill.intra.peff.net>
In-Reply-To
<20180103003946.GC12108@zaya.teonanacatl.net>
On Tue, Jan 02, 2018 at 07:39:46PM -0500, Todd Zullinger wrote:
Show 15 quoted lines
> Brandon Williams wrote:
> > Seems good to me.  I think I was just being overly cautious when i was
> > implementing those patches.  Thanks!
> 
> Cool, thanks for taking a look.
> 
> In this case, the test isn't dependent on apache > 2.4, but
> before I checked that I wondered if we had any way to run a
> test only if the apache version was greater or lesser than
> some release.  Luckily, I didn't have to work out such a
> method. :)
> 
> I don't know if there's a clean way to do that
> automatically, short of parsing the output of 'httpd -v'
> should we ever need to add such a prereq.

In the general case, we could probably define an endpoint within an <If> block, and then try to access the endpoint from the test script.

E.g., something like:
    <IfVersion >= 2.4>
    Alias /have-2.4.txt www/yes.txt
    </IfVersion>
in the apache config, and then:
  test_lazy_prereq APACHE24 '
        echo yes >"$HTTPD_DOCUMENT_ROOT_PATH/yes.txt" &&
        curl -f "$HTTPD_URL/have-2.4.txt"
  '

in the test script (of course we may not want to depend on having command-line curl, but we could replace that with "git ls-remote" or similar).

One nice thing about that approach is that it can be extended to other "If" blocks, like if we have a particular module available, or if ssl is configured.

-Peff
Previous: Todd ZullingerNext: Todd Zullinger
Message 4 of 6 in “http: fix v1 protocol tests with apache httpd < 2.4”
  1. http: fix v1 protocol tests with apache httpd < 2.4Todd Zullinger, Dec 31, 2017
  2. Brandon WilliamsJan 3, 2018
  3. Todd ZullingerJan 3, 2018
  4. Jeff KingJan 3, 2018
  5. Todd ZullingerJan 3, 2018
  6. Jeff KingJan 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.