]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
pytest_suite: fix startup failures and add missing Perl helper templates
authorJim Jagielski <jim@apache.org>
Wed, 3 Jun 2026 17:21:22 +0000 (17:21 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 3 Jun 2026 17:21:22 +0000 (17:21 +0000)
commit264f12f311010537dce5dbe40fd62e92d444fe23
treef5f50d24c61091139b9c40f1c80133cb78eed0e2
parent3e669ae090192eff88733e21f4e81a34c5e3e5e9
pytest_suite: fix startup failures and add missing Perl helper templates

Three bugs fixed in the pytest framework:

1. cmodules.py: compiled C test modules were not rebuilt when apxs changed
   (e.g. upgrading from Apache 2.4 to 2.5). The staleness check now also
   compares the .so mtime against apxs itself, so a newer apxs always
   triggers a rebuild and prevents API-signature mismatches (AP24 vs AP25).
   Add clean_modules() to remove all apxs build artifacts (make clean
   equivalent), exposed as --clean-modules pytest option and routed only
   to pytest_suite (not pyhttpd) in run-all-tests.sh.

2. server.py: httpd was started without -DFOREGROUND, so the MPM parent
   forked and exited (code 0) before the port opened. The framework
   misread the fork-exit as a crash and killed the running daemon.
   Add -DFOREGROUND so the Popen process IS the httpd parent.

3. Missing Perl helper scripts: t/conf/extra.conf.in declares a prg-type
   RewriteMap (numbers-prg) whose program file did not exist, causing
   httpd to refuse to start. More broadly, all *.pl CGI scripts,
   ext_filter programs, rewrite-map programs, and the SSL passphrase
   helper referenced by the config and tests were absent.
   Add the full set of *.pl.PL source templates (copied from the
   httpd-tests framework), covering:
     - t/conf/ssl/httpd-passphrase.pl.PL
     - t/htdocs/apache/http_strict/send_hdr.pl.PL (new dir)
     - t/htdocs/modules/cgi/  (28 CGI scripts)
     - t/htdocs/modules/ext_filter/  (2 filter programs, new dir)
     - t/htdocs/modules/negotiation/query/test.pl.PL
     - t/htdocs/modules/rewrite/  (numbers, numbers2, db)
   generate_pl_scripts() regenerates the .pl executables from these
   templates at each test-session start with the correct local perl shebang.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934936 13f79535-47bb-0310-9956-ffa450edef68
39 files changed:
test/pytest_suite/apache_pytest/__init__.py
test/pytest_suite/apache_pytest/cmodules.py
test/pytest_suite/apache_pytest/server.py
test/pytest_suite/conftest.py
test/pytest_suite/t/conf/ssl/httpd-passphrase.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/apache/http_strict/send_hdr.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/action.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/big.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/bogus-perl.pl.PL [new file with mode: 0755]
test/pytest_suite/t/htdocs/modules/cgi/bogus1k.pl.PL [new file with mode: 0755]
test/pytest_suite/t/htdocs/modules/cgi/empty.pl.PL [new file with mode: 0755]
test/pytest_suite/t/htdocs/modules/cgi/env.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/not-modified.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/nph-102.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/nph-dripfeed.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/nph-foldhdr.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/nph-interim1.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/nph-interim2.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/nph-stderr.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/nph-test.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/ocsp.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/perl.pl.PL [new file with mode: 0755]
test/pytest_suite/t/htdocs/modules/cgi/perl_echo.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/perl_post.pl.PL [new file with mode: 0755]
test/pytest_suite/t/htdocs/modules/cgi/pr37166.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/ranged.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/redirect.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/stderr1.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/stderr2.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/stderr3.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/unique-id.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/cgi/xother.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/ext_filter/eval-cmd.pl.PL [new file with mode: 0755]
test/pytest_suite/t/htdocs/modules/ext_filter/sleepycat.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/negotiation/query/test.pl.PL [new file with mode: 0755]
test/pytest_suite/t/htdocs/modules/rewrite/db.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/rewrite/numbers.pl.PL [new file with mode: 0644]
test/pytest_suite/t/htdocs/modules/rewrite/numbers2.pl.PL [new file with mode: 0755]
test/run-all-tests.sh