svn commit: r1935051 - in httpd/httpd/trunk/test/pytest_suite: apache_pytest tests/t/filter

[email protected] Fri, 05 Jun 2026 20:08:05 -0000
Newsgroups gmane.comp.apache.cvs
Message-ID <178069008543.3252027.4336516449482800324@svn03-he-fi>
Author: jim
Date: Fri Jun  5 20:08:05 2026
New Revision: 1935051

Log:
Picked up a small PERL pods regression - fixed

Modified:
   httpd/httpd/trunk/test/pytest_suite/apache_pytest/config.py
   httpd/httpd/trunk/test/pytest_suite/tests/t/filter/test_case.py

Modified: httpd/httpd/trunk/test/pytest_suite/apache_pytest/config.py
==============================================================================
--- httpd/httpd/trunk/test/pytest_suite/apache_pytest/config.py	Fri Jun  5 20:07:27 2026	(r1935050)
+++ httpd/httpd/trunk/test/pytest_suite/apache_pytest/config.py	Fri Jun  5 20:08:05 2026	(r1935051)
@@ -30,6 +30,28 @@ from .probe import HttpdInfo
 
 DEFAULT_PORT = 8529
 
+
+def _find_perl_pods(perl: str) -> str:
+    """Locate perl's 'pods' directory, like Apache::TestConfig's
+    find_in_inc('pods') (TestConfig.pm:297): the first 'pods' dir under @INC.
+
+    Returns the absolute path, or "" if perl is unavailable or has no pods dir
+    (e.g. a perl without perl-doc installed). Used for the /getfiles-perl-pod
+    alias that t/filter/case.t downloads from.
+    """
+    if not perl:
+        return ""
+    import subprocess
+
+    code = "for (@INC){ if (-d qq($_/pods)){ print qq($_/pods); last } }"
+    try:
+        out = subprocess.run(
+            [perl, "-e", code], capture_output=True, text=True, timeout=10
+        ).stdout.strip()
+    except (OSError, subprocess.SubprocessError):
+        return ""
+    return out if out and Path(out).is_dir() else ""
+
 # @CGI_MODULE@ etc. -> first candidate that is actually loaded, else first candidate.
 # Mirrors the default_module() calls in TestConfig.pm:435-440.
 MODULE_NAME_CANDIDATES: dict[str, list[str]] = {
@@ -284,13 +306,16 @@ class TestConfig:
         v["serveradmin"] = f"unknown@{servername}"
         v["inherit_documentroot"] = v["documentroot"]
         # getfiles-* download aliases (see generate_httpd_conf %aliases). httpd
-        # is the probed binary; perl is whatever runs the helper scripts. perlpod
-        # is left empty (its alias is only emitted when the var is set).
+        # is the probed binary; perl is whatever runs the helper scripts.
         v["httpd"] = str(self.info.httpd)
         from shutil import which
 
         v["perl"] = which("perl") or ""
-        v["perlpod"] = ""
+        # perlpod: a 'pods' dir under @INC, like Perl's find_in_inc('pods')
+        # (TestConfig.pm:297). Drives the /getfiles-perl-pod alias that
+        # t/filter/case.t (mod_alias case) downloads from. Left "" if not found,
+        # in which case the alias is not emitted and that subtest skips.
+        v["perlpod"] = _find_perl_pods(v["perl"])
 
         # MPM tuning math (TestConfig.pm:331-373) with proxy off (no bump).
         tpc = 10

Modified: httpd/httpd/trunk/test/pytest_suite/tests/t/filter/test_case.py
==============================================================================
--- httpd/httpd/trunk/test/pytest_suite/tests/t/filter/test_case.py	Fri Jun  5 20:07:27 2026	(r1935050)
+++ httpd/httpd/trunk/test/pytest_suite/tests/t/filter/test_case.py	Fri Jun  5 20:08:05 2026	(r1935051)
@@ -46,4 +46,8 @@ def test_case_filter_root(http):
 def test_case_filter_module(http, module):
     if not http.have_module(module):
         pytest.skip(f"{module} not available")
+    # The mod_alias URL downloads from the /getfiles-perl-pod alias, which is
+    # only generated when perl's 'pods' dir was found (perl-doc installed).
+    if module == "mod_alias" and not http.vars("perlpod"):
+        pytest.skip("no perl 'pods' dir (perl-doc) for the getfiles-perl-pod alias")
     _verify(http.GET(URLS[module], headers=FILTER))