You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2026/09/28 16:36:07 UTC

svn commit: r1938621 - in httpd/httpd/branches/2.4.x: . test test/pytest_suite test/pytest_suite/apache_pytest test/pytest_suite/t test/pytest_suite/t/conf test/pytest_suite/t/htdocs test/pytest_suite/t/htdocs/apache/cfg_getline test/pytest_suite/t/htd...

Author: jorton
Date: Mon Sep 28 16:36:07 2026
New Revision: 1938621

Log:
Merge r1936869, r1936871, r1936872, r1936969, r1936972, r1936976, r1937025, r1937082, r1937083, r1937102, r1937129, r1937130, r1937132, r1937272, r1937534, r1938269 from trunk:

* test/pytest_suite: Import/translate gitignore from the svn:ignore orignals. [skip ci]

* test/pytest_suite/apache_pytest/fpm.py (PhpFpm.generate_conf): Set
register_argc_argv so PHP tests see $_SERVER['argc']/['argv'] under
FPM, which mod_php's config for this never actually reached.

Assisted-by: Claude Sonnet 5 <no...@anthropic.com>

* test/pytest_suite/tests/t/ab/test_base.py (_ab_path): Don't
  resolve() the httpd path before deriving ab's; it follows the
  check/bin/httpd symlink out of the check/ tree, so ab was never
  found there.

Assisted-by: Claude Sonnet 5 <no...@anthropic.com>

* test/pytest_suite/.gitignore: Ignore generated .htaccess files,
  t/conf/cacheroot/, t/htdocs/modules/autoindex2/,
  t/htdocs/modules/substitute/test.txt, and t/state/.

* test/pytest_suite/t/htdocs/apache/cfg_getline/.htaccess,
  authz_core/a/.htaccess, authz_core/a/b/.htaccess,
  authz_core/a/b/c/.htaccess: Remove stale generated content that
  had been committed by mistake.

Assisted-by: Claude Sonnet 5 <no...@anthropic.com>

Remove files (missed in previous commit r1936969) -

* test/pytest_suite/t/htdocs/apache/cfg_getline/.htaccess,
  authz_core/a/.htaccess, authz_core/a/b/.htaccess,
  authz_core/a/b/c/.htaccess: Remove stale generated content that
  had been committed by mistake.

Fix false negatives checking error_log with test_proxy_beacon: [skip ci]

* test/pytest_suite/conftest.py (framework): Record error_log's size
  before httpd starts, as session_log_start.

* test/pytest_suite/tests/t/modules/test_proxy_beacon.py
  (test_proxy_beacon): Scope the "added backend" log check to
  session_log_start instead of the per-test window or byte 0.

Assisted-by: Claude Sonnet 5 <no...@anthropic.com>


* test/pytest_suite/apache_pytest/config.py (_build_vars): Add
  @STATEDIR@ config template variable.

* test/pytest_suite/t/conf/cache.conf.in, tests/t/modules/test_cache.py:
  Use @STATEDIR@/cacheroot/ for CacheRoot, instead of t/conf/cacheroot.

Assisted-by: Claude Sonnet 5 <no...@anthropic.com>

Arrange the testsuite to run it on windows.
used claude ai for the investigation.

the bat, use
set APACHE_TEST_PERL=C:/Strawberry/perl/bin/perl.exe and
--httpd=..\httpd.exe and --conf=..\httpd.conf to an install httpd in the box.

build the test modules using cmake, that is for windows where we don't have apxs.

Arrange python detection.

Arrange to pass more tests on windows.

rollback, won't help.

skip some tests that won't pass on windows.
arrange others and add --with-perl to runtests.bat.

* test/pytest_suite: Ignore generate file t/basic1. [skip ci]

* test/pytest_suite: Remove some left-behind generated
  files, update svn:ignore and .gitignore to ignore them.

Submitted by: jorton, jfclere

Added:
   httpd/httpd/branches/2.4.x/test/pytest_suite/.gitignore
      - copied, changed from r1936869, httpd/httpd/trunk/test/pytest_suite/.gitignore
   httpd/httpd/branches/2.4.x/test/pytest_suite/gen_test_header.py
      - copied unchanged from r1937102, httpd/httpd/trunk/test/pytest_suite/gen_test_header.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/runtests.bat
      - copied, changed from r1937083, httpd/httpd/trunk/test/pytest_suite/runtests.bat
Deleted:
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/basic1
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/form1
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/groups1
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/apache/cfg_getline/.htaccess
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/apache/chunked/byteranges.txt
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/authz_core/a/.htaccess
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/authz_core/a/b/.htaccess
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/authz_core/a/b/c/.htaccess
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/index.html
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/alias/script
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/vhost_alias/
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/realm1
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/realm2
Modified:
   httpd/httpd/branches/2.4.x/   (props changed)
   httpd/httpd/branches/2.4.x/CMakeLists.txt
   httpd/httpd/branches/2.4.x/test/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/config.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/fpm.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/scripts.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/server.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/conftest.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/cache.conf.in
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/extra.conf.in
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/apache/cfg_getline/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/apache/chunked/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/authz_core/a/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/authz_core/a/b/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/authz_core/a/b/c/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/alias/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/cgi/nph-foldhdr.pl.PL
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/dir/htaccess/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/expires/htaccess/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/substitute/   (props changed)
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ab/test_base.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_acceptpathinfo.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_byterange2.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_mmn.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr37166.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr49328.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_access.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_actions.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_alias.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_authz_core.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cache.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cgi.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_ext_filter.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_include.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_negotiation.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_beacon.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_fcgi.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_rewrite.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_sed.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_session.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_speling.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_substitute.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_vhost_alias.py
   httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ssl/test_pr43738.py

Modified: httpd/httpd/branches/2.4.x/CMakeLists.txt
==============================================================================
--- httpd/httpd/branches/2.4.x/CMakeLists.txt	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/CMakeLists.txt	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -408,6 +408,66 @@ SET(MODULE_LIST
   "modules/test/mod_optional_hook_import+O+example optional hook importer"
 )
 
+IF(BUILD_TEST_MODULES)
+  LIST(APPEND MODULE_LIST
+    "test/pyhttpd/mod_aptest/mod_aptest+A+Test module. Useful only for developers and testing purposes."
+    "test/modules/http1/mod_h1test/mod_h1test+A+Http/1 Test module. Useful only for developers and testing purposes."
+    "test/modules/http2/mod_h2test/mod_h2test+A+Http/2 Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/authany/mod_authany+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/client_add_filter/mod_client_add_filter+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/eat_post/mod_eat_post+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/echo_post/mod_echo_post+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/echo_post_chunk/mod_echo_post_chunk+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/fold/mod_fold+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/input_body_filter/mod_input_body_filter+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/list_modules/mod_list_modules+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/memory_track/mod_memory_track+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/nntp_like/mod_nntp_like+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/random_chunk/mod_random_chunk+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/test_apr_uri/mod_test_apr_uri+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/test_pass_brigade/mod_test_pass_brigade+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/test_rwrite/mod_test_rwrite+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/test_session/mod_test_session+A+Test module. Useful only for developers and testing purposes."
+    "test/pytest_suite/c-modules/test_utilities/mod_test_utilities+A+Test module. Useful only for developers and testing purposes."
+  )
+ENDIF()
+IF(BUILD_TEST_MODULES AND OPENSSL_FOUND)
+  LIST(APPEND MODULE_LIST
+    "test/pytest_suite/c-modules/test_ssl/mod_test_ssl+A+Test module. Useful only for developers and testing purposes."
+  )
+ENDIF()
+
+IF(BUILD_TEST_MODULES)
+  SET(PYTEST_CMODULES_DIR "${CMAKE_SOURCE_DIR}/test/pytest_suite/c-modules")
+  IF(WIN32)
+    file(GLOB _python_hints "$ENV{LOCALAPPDATA}/Programs/Python/Python3*"
+                            "$ENV{PROGRAMFILES}/Python3*")
+    find_program(PYTHON_EXE NAMES py python3 python
+      HINTS ${_python_hints}
+    )
+    IF(NOT PYTHON_EXE)
+      MESSAGE(FATAL_ERROR "Python interpreter not found, required for BUILD_TEST_MODULES")
+    ENDIF()
+    execute_process(
+      COMMAND "${PYTHON_EXE}" "${CMAKE_SOURCE_DIR}/test/pytest_suite/gen_test_header.py" "${PYTEST_CMODULES_DIR}/apache_httpd_test.h"
+      RESULT_VARIABLE _gen_header_rc
+    )
+    IF(NOT _gen_header_rc EQUAL 0)
+      MESSAGE(FATAL_ERROR "Failed to generate apache_httpd_test.h (exit ${_gen_header_rc})")
+    ENDIF()
+  ENDIF()
+  SET(PYTEST_CMODULE_DEFINES APACHE2 APACHE2_4)
+  FOREACH(pytest_mod
+      mod_authany mod_client_add_filter mod_eat_post mod_echo_post
+      mod_echo_post_chunk mod_fold mod_input_body_filter mod_list_modules
+      mod_memory_track mod_nntp_like mod_random_chunk mod_test_apr_uri
+      mod_test_pass_brigade mod_test_rwrite mod_test_session
+      mod_test_utilities mod_test_ssl)
+    SET(${pytest_mod}_extra_defines ${PYTEST_CMODULE_DEFINES})
+  ENDFOREACH()
+  SET(mod_test_session_extra_libs mod_session)
+ENDIF()
+
 # Track which modules actually built have APIs to link against.
 SET(installed_mod_libs_exps)
 
@@ -722,6 +782,12 @@ SET(HTTPD_INCLUDE_DIRECTORIES
   ${PCRE_INCLUDE_DIR}
 )
 
+IF(BUILD_TEST_MODULES)
+  LIST(APPEND HTTPD_INCLUDE_DIRECTORIES
+    ${CMAKE_CURRENT_SOURCE_DIR}/test/pytest_suite/c-modules
+  )
+ENDIF()
+
 # The .h files we install from outside the main include directory
 # largely parallel the include directories above.
 SET(other_installed_h
@@ -842,8 +908,8 @@ FOREACH (mod ${MODULE_PATHS})
 
     # Extra defines?
     SET(mod_extra_defines "${mod_name}_extra_defines")
-    IF(NOT ${${mod_extra_defines}} STREQUAL "")
-      SET_TARGET_PROPERTIES(${mod_name} PROPERTIES COMPILE_DEFINITIONS ${${mod_extra_defines}})
+    IF(NOT "${${mod_extra_defines}}" STREQUAL "")
+      TARGET_COMPILE_DEFINITIONS(${mod_name} PRIVATE ${${mod_extra_defines}})
     ENDIF()
 
     # Extra includes?

Copied and modified: httpd/httpd/branches/2.4.x/test/pytest_suite/.gitignore (from r1936869, httpd/httpd/trunk/test/pytest_suite/.gitignore)
==============================================================================
--- httpd/httpd/trunk/test/pytest_suite/.gitignore	Tue Aug  4 14:51:57 2026	(r1936869, copy source)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/.gitignore	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -1,3 +1,15 @@
+# Python / tooling caches
+# (SVN covers these via svn:global-ignores on this directory; git needs them
+# listed here because the root .gitignore's test/*/*/__pycache__ does not reach
+# tests/t/*/__pycache__.)
+__pycache__/
+*.pyc
+*.pyo
+.pytest_cache/
+.ruff_cache/
+.venv/
+.env
+
 # C modules build artifacts
 c-modules/Makefile
 c-modules/apache_httpd_test.h
@@ -12,15 +24,49 @@ c-modules/*/*.o
 t/TEST
 t/conf/apache_test_config.pm
 t/conf/*.conf
+t/conf/mime.types
 t/conf/ssl/*.pl
 t/conf/ssl/*.conf
 t/conf/ssl/ca
+t/conf/cacheroot/
 t/logs/
+t/state/
+t/md/
+
+# Generated htpasswd / htdigest files
+t/basic1
+t/form1
+t/groups1
+t/realm1
+t/realm2
 
 # Generated test scripts
 t/htdocs/**/*.pl
+t/htdocs/modules/alias/script
+
+# Generated .htaccess files
+t/htdocs/apache/cfg_getline/.htaccess
+t/htdocs/apache/expr/.htaccess
+t/htdocs/authz_core/a/.htaccess
+t/htdocs/authz_core/a/b/.htaccess
+t/htdocs/authz_core/a/b/c/.htaccess
 t/htdocs/modules/access/htaccess/.htaccess
+t/htdocs/modules/dir/htaccess/.htaccess
+t/htdocs/modules/expires/htaccess/.htaccess
+t/htdocs/modules/headers/htaccess/.htaccess
+t/htdocs/modules/setenvif/htaccess/.htaccess
+t/htdocs/modules/substitute/.htaccess
+
+# Generated document-root content
+t/htdocs/index.html
+t/htdocs/apache/chunked/byteranges.txt
+t/htdocs/modules/autoindex/
+t/htdocs/modules/autoindex2/
+t/htdocs/modules/dav/
+t/htdocs/modules/substitute/test.txt
+t/htdocs/modules/vhost_alias/
 
 # Logs
 t/php-fpm/log/
-
+t/php-fpm/run/
+t/php-fpm/var/

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/config.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/config.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/config.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -22,6 +22,7 @@ from __future__ import annotations
 
 import re
 import socket
+import sys
 from collections.abc import Iterator
 from dataclasses import dataclass, field
 from pathlib import Path
@@ -290,14 +291,15 @@ class TestConfig:
         v: dict[str, str] = {}
         v["top_dir"] = str(top_dir)
         v["t_dir"] = str(t_dir)
-        v["serverroot"] = str(serverroot)
-        v["documentroot"] = str(serverroot / "htdocs")
-        v["t_conf"] = str(serverroot / "conf")
-        v["t_logs"] = str(serverroot / "logs")
-        v["t_state"] = str(serverroot / "state")
-        v["t_conf_file"] = str(serverroot / "conf" / "httpd.conf")
-        v["t_pid_file"] = str(serverroot / "logs" / "httpd.pid")
-        v["sslca"] = str(serverroot / "conf" / "ssl" / "ca")
+        v["serverroot"] = str(serverroot).replace("\\", "/")
+        v["documentroot"] = v["serverroot"] + "/htdocs"
+        v["t_conf"] = v["serverroot"] + "/conf"
+        v["t_logs"] = v["serverroot"] + "/logs"
+        v["t_state"] = v["serverroot"] + "/state"
+        v["statedir"] = v["t_state"]
+        v["t_conf_file"] = v["t_conf"] + "/httpd.conf"
+        v["t_pid_file"] = v["t_logs"] + "/httpd.pid"
+        v["sslca"] = v["t_conf"] + "/ssl/ca"
         v["sslcaorg"] = "asf"
         v["sslproto"] = "all"
         v["scheme"] = "http"
@@ -308,9 +310,9 @@ class TestConfig:
         # getfiles-* download aliases (see generate_httpd_conf %aliases). httpd
         # is the probed binary; perl is whatever runs the helper scripts.
         v["httpd"] = str(self.info.httpd)
-        from shutil import which
+        from .scripts import default_perl
 
-        v["perl"] = which("perl") or ""
+        v["perl"] = default_perl()
         # 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,
@@ -496,7 +498,7 @@ class TestConfig:
             rewritten = self._maybe_rewrite_vhost(expanded)
             out_lines.append(rewritten if rewritten is not None else expanded)
         out_path = conf_in.with_suffix("")  # strip ".in" -> ".conf"
-        out_path.write_text("\n".join(out_lines) + "\n")
+        out_path.write_text("\n".join(out_lines) + "\n", newline="\n")
         return out_path
 
     def conf_in_files(self) -> list[Path]:
@@ -536,7 +538,7 @@ class TestConfig:
         else:
             mime = Path(self.vars["t_conf"]) / "mime.types"
             if not mime.exists():
-                mime.write_text(self.MIME_TYPES)
+                mime.write_text(self.MIME_TYPES, newline="\n")
             self.postamble.append(
                 f'<IfModule mod_mime.c>\n    TypesConfig "{mime}"\n</IfModule>'
             )
@@ -545,14 +547,16 @@ class TestConfig:
         index = Path(self.vars["documentroot"]) / "index.html"
         if not index.exists():
             index.write_text(
-                f"welcome to {self.vars['servername']}:{self.vars['port']}\n"
+                f"welcome to {self.vars['servername']}:{self.vars['port']}\n",
+                newline="\n",
             )
 
     def _load_module_preamble(self, name: str, so: Path) -> None:
         """Append a guarded LoadModule (find_and_load_module, TestConfig.pm:1329)."""
+        so_fwd = str(so).replace("\\", "/")
         self.preamble.append(
             f'<IfModule !mod_{name}.c>\n'
-            f'    LoadModule {name}_module "{so}"\n'
+            f'    LoadModule {name}_module "{so_fwd}"\n'
             f'</IfModule>'
         )
 
@@ -561,14 +565,20 @@ class TestConfig:
 
         Mirrors find_and_load_module (TestConfig.pm:1329): emits a guarded
         LoadModule into the preamble. We reuse the inherited load directive's .so
-        path when present; otherwise we skip (the module is built-in or absent).
+        path when present; otherwise scan the install modules directory.
         """
         sym = mod[len("mod_"):] if mod.startswith("mod_") else mod
         cname = f"mod_{sym}.c"
         for d in self.info.load_directives:
             if d.cname == cname and Path(d.so).exists():
                 self._load_module_preamble(sym, Path(d.so))
+                self.info.modules.add(cname)
                 return
+        modules_dir = self.info.httpd.parent.parent / "modules"
+        so = modules_dir / f"mod_{sym}.so"
+        if so.exists():
+            self._load_module_preamble(sym, so)
+            self.info.modules.add(cname)
 
     # %aliases map (TestConfig.pm:1604): label -> var holding the path.
     _GETFILES_ALIASES = {
@@ -584,7 +594,7 @@ class TestConfig:
             var = self._GETFILES_ALIASES[label]
             val = self.vars.get(var)
             if val:
-                lines.append(f"    Alias /getfiles-{label} {val}")
+                lines.append(f'    Alias /getfiles-{label} "{val}"')
         lines.append("</IfModule>")
         return "\n".join(lines)
 
@@ -673,9 +683,10 @@ class TestConfig:
         for d in self.info.load_directives:
             if not _Path(d.so).exists():
                 continue
+            so = d.so.replace("\\", "/")
             self.preamble.append(
                 f"<IfModule !{d.cname}>\n"
-                f'    LoadModule {d.symbol} "{d.so}"\n'
+                f'    LoadModule {d.symbol} "{so}"\n'
                 f"</IfModule>"
             )
 
@@ -835,12 +846,15 @@ class TestConfig:
         # accumulate across modules and are flushed once at the end.
         cmodule_args: list[str] = []
         for sym, so in cmodule_loads or []:
-            self.preamble.append(f'LoadModule {sym}_module "{so}"')
+            so_fwd = str(so).replace("\\", "/")
+            self.preamble.append(f'LoadModule {sym}_module "{so_fwd}"')
             # Register the module in the modules set so <VirtualHost mod_X>
             # rewriting recognizes it (TestConfigC.pm:308 $self->{modules}{$cname}=1).
             self.info.modules.add(f"mod_{sym}.c")
-            # so is <src_dir>/.libs/mod_<sym>.so; source is <src_dir>/mod_<sym>.c
+            # so is <src_dir>/.libs/mod_<sym>.so (apxs) or <prefix>/modules/ (CMake).
             c_source = so.parent.parent / f"mod_{sym}.c"
+            if not c_source.is_file():
+                c_source = Path(self.vars["top_dir"]) / "c-modules" / sym / f"mod_{sym}.c"
             if c_source.is_file():
                 self.add_module_config(c_source, cmodule_args)
         if cmodule_args:
@@ -858,13 +872,27 @@ class TestConfig:
             generated.append(self.process_conf_in(f))
             self._check_vars()
         for g in sorted(generated):
-            self.postamble.append(f'Include "{g}"')
+            g_fwd = str(g).replace("\\", "/")
+            self.postamble.append(f'Include "{g_fwd}"')
 
         # mod_mime/mod_alias may be shared and absent from the system conf; load
         # them defensively. Order matches Perl: generate_types_config loads
         # mod_mime first (TestConfig.pm:1394), then mod_alias (TestConfig.pm:1635).
         self._find_and_load_fallback("mod_mime")
         self._find_and_load_fallback("mod_alias")
+        # httpd-built test/experimental modules not in the default httpd.conf
+        for mod in ("mod_bucketeer", "mod_case_filter", "mod_case_filter_in",
+                     "mod_echo", "mod_log_debug", "mod_reflector", "mod_data"):
+            self._find_and_load_fallback(mod)
+
+        # On Windows, tell mod_cgi to read the #! shebang line instead of
+        # using the Registry file association to find the script interpreter.
+        if sys.platform == "win32":
+            self.postamble.append(
+                "<IfModule mod_cgi.c>\n"
+                "    ScriptInterpreterSource Script\n"
+                "</IfModule>"
+            )
 
         # Assemble httpd.conf in generate_httpd_conf order (TestConfig.pm:1609-1690).
         parts: list[str] = []
@@ -879,5 +907,5 @@ class TestConfig:
         parts.extend(self.postamble)
 
         conf = Path(self.vars["t_conf_file"])
-        conf.write_text("\n".join(parts) + "\n")
+        conf.write_text("\n".join(parts) + "\n", newline="\n")
         return conf

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/fpm.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/fpm.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/fpm.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -60,6 +60,11 @@ class PhpFpm:
             # Surface PHP errors/warnings to the response for test visibility.
             "catch_workers_output = yes\n"
             "clear_env = no\n"
+            # t/php/arg.php et al require argc/argv in $_SERVER. Under mod_php
+            # this came from extra.conf.in's php_admin_flag, but that's inside
+            # an <IfModule> keyed on a mod_php variant that's never loaded when
+            # running under FPM, so it never applied -- set it here instead.
+            "php_admin_value[register_argc_argv] = On\n"
         )
         return self.conf
 

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/scripts.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/scripts.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/scripts.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -49,7 +49,7 @@ def generate_pl_scripts(root: Path, *, p
             continue
         target = pl.with_suffix("")  # strip ".PL" -> "...pl"
         body = pl.read_text()
-        target.write_text(_shebang() + body)
+        target.write_text(_shebang() + body, newline="\n")
         target.chmod(target.stat().st_mode | stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP)
         generated.append(target)
     return generated
@@ -59,4 +59,5 @@ def default_perl() -> str:
     """Best-effort path to a perl interpreter for the generated shebangs."""
     from shutil import which
 
-    return which("perl") or PERL or sys.executable
+    path = PERL or which("perl") or sys.executable
+    return path.replace("\\", "/")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/server.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/server.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/apache_pytest/server.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -18,6 +18,7 @@ from __future__ import annotations
 import contextlib
 import errno
 import os
+import sys
 import signal
 import socket
 import subprocess
@@ -66,9 +67,15 @@ def _killpg_or_pid(pid: int, sig: int) -
     the parent's process group id (== parent pid), so signalling the group with
     ``os.killpg`` reaches the parent and all its workers. If the process is not
     a group leader (no such pgid) we fall back to signalling the bare pid.
+
+    On Windows there are no process groups; use ``os.kill`` directly.
     """
     if pid <= 0:
         return
+    if sys.platform == "win32":
+        with contextlib.suppress(OSError):
+            os.kill(pid, sig)
+        return
     try:
         os.killpg(pid, sig)
     except OSError as exc:
@@ -159,9 +166,11 @@ class HttpdServer:
                     break
                 time.sleep(0.1)
             if _pid_alive(pid):
-                _killpg_or_pid(pid, signal.SIGKILL)
-                with contextlib.suppress(OSError):
-                    os.waitpid(pid, 0)  # reap if it happens to be our child
+                kill_sig = signal.SIGTERM if sys.platform == "win32" else signal.SIGKILL
+                _killpg_or_pid(pid, kill_sig)
+                if sys.platform != "win32":
+                    with contextlib.suppress(OSError):
+                        os.waitpid(pid, 0)  # reap if it happens to be our child
         if pid_file.exists():
             with contextlib.suppress(OSError):
                 pid_file.unlink()
@@ -180,8 +189,11 @@ class HttpdServer:
         # start_new_session=True (setsid) puts httpd in its own process group so
         # the parent and all forked MPM children can be signalled together via
         # os.killpg, guaranteeing no orphaned children survive a failed start.
+        popen_kwargs = {}
+        if sys.platform != "win32":
+            popen_kwargs["start_new_session"] = True
         self.proc = subprocess.Popen(  # noqa: S603 - trusted paths
-            self.args(), start_new_session=True
+            self.args(), **popen_kwargs
         )
         deadline = time.monotonic() + timeout
         while time.monotonic() < deadline:
@@ -214,7 +226,8 @@ class HttpdServer:
             try:
                 proc.wait(timeout=timeout)
             except subprocess.TimeoutExpired:
-                _killpg_or_pid(pgid_pid, signal.SIGKILL)
+                kill_sig = signal.SIGTERM if sys.platform == "win32" else signal.SIGKILL
+                _killpg_or_pid(pgid_pid, kill_sig)
                 with contextlib.suppress(subprocess.TimeoutExpired):
                     proc.wait(timeout=timeout)
         elif proc is not None:

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/conftest.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/conftest.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/conftest.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -65,6 +65,27 @@ def pytest_addoption(parser: pytest.Pars
         default=False,
         help="remove all compiled C-module artifacts before building (emulate make clean)",
     )
+    group.addoption(
+        "--conf",
+        action="store",
+        default=None,
+        help="path to the installed httpd.conf (for LoadModule discovery "
+        "when --apxs is not available, e.g. on Windows)",
+    )
+    group.addoption(
+        "--prefix",
+        action="store",
+        default=None,
+        help="server install prefix for resolving relative module paths "
+        "(default: derived from --conf path)",
+    )
+    group.addoption(
+        "--with-perl",
+        action="store",
+        default=None,
+        help="path to the perl interpreter for generated scripts and "
+        "rewrite prg-maps (default: /usr/bin/perl or APACHE_TEST_PERL env)",
+    )
 
 
 def pytest_configure(config: pytest.Config) -> None:
@@ -114,6 +135,16 @@ def _resolve_paths(
         inherited_conf = sysconfdir / "httpd.conf"
         if httpd_opt is None:
             httpd_opt = str(sbindir / "httpd")
+
+    conf_opt = config.getoption("--conf")
+    prefix_opt = config.getoption("--prefix")
+    if conf_opt is not None and inherited_conf is None:
+        inherited_conf = Path(conf_opt)
+    if prefix_opt is not None:
+        install_prefix = Path(prefix_opt)
+    elif inherited_conf is not None and install_prefix is None:
+        install_prefix = inherited_conf.parent.parent
+
     if httpd_opt is None:
         raise _NoServerError("must pass --httpd or --apxs")
     return Path(httpd_opt), apxs, inherited_conf, install_prefix, defines
@@ -213,6 +244,11 @@ def framework(request: pytest.FixtureReq
 
     info = probe(httpd, inherited_conf, install_prefix)
 
+    perl_opt = request.config.getoption("--with-perl")
+    if perl_opt:
+        import os
+        os.environ["APACHE_TEST_PERL"] = perl_opt
+
     # Optional PHP-FPM: if a php-fpm binary was given and mod_proxy_fcgi is
     # available, route htdocs/php/*.php to a managed FPM daemon. The php-fpm
     # path/port are the only PHP-specific inputs -- no version is assumed.
@@ -237,6 +273,14 @@ def framework(request: pytest.FixtureReq
         cmodule_loads, _skipped = compile_all(
             cmodules_dir, apxs, info, defines=["APACHE2", "APACHE2_4", *defines]
         )
+    else:
+        from apache_pytest.cmodules import discover
+        modules_dir = (install_prefix / "modules") if install_prefix else httpd.parent
+        cmods, _skipped = discover(REPO_ROOT / "c-modules", info)
+        for mod in cmods:
+            so = modules_dir / f"mod_{mod.name}.so"
+            if so.exists():
+                cmodule_loads.append((mod.symbol, so))
 
     config.generate(cmodule_loads=cmodule_loads)
 
@@ -250,6 +294,18 @@ def framework(request: pytest.FixtureReq
         )
         fpm_mgr.start()
 
+    # Record the error_log size right before this session's httpd starts.
+    # error_log is opened in append mode and t_logs/ is not cleaned between
+    # invocations, so it can carry entries from earlier, unrelated test runs
+    # (possibly hours/days old, with different pids). Tests that need "since
+    # this server session started" (as opposed to "since this individual
+    # test started") must scope their log reads to this offset, not to
+    # position 0 -- see test_proxy_beacon.py.
+    error_log = Path(config.vars["t_logs"]) / "error_log"
+    config.vars["session_log_start"] = str(
+        error_log.stat().st_size if error_log.exists() else 0
+    )
+
     server = HttpdServer(config)
     server.start()
     try:

Copied: httpd/httpd/branches/2.4.x/test/pytest_suite/gen_test_header.py (from r1937102, httpd/httpd/trunk/test/pytest_suite/gen_test_header.py)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/gen_test_header.py	Mon Sep 28 16:36:07 2026	(r1938621, copy of r1937102, httpd/httpd/trunk/test/pytest_suite/gen_test_header.py)
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+"""Generate apache_httpd_test.h for CMake builds.
+
+Calls the same generate_header() from apache_pytest/cmodules.py that
+the Unix/apxs build uses, but without importing the full apache_pytest
+package (which requires httpx and other test dependencies).
+"""
+import sys
+import types
+from pathlib import Path
+
+# Stub out the apache_pytest package so cmodules.py can be loaded
+# without pulling in httpx and other test-only dependencies.
+pkg = types.ModuleType('apache_pytest')
+pkg.__path__ = [str(Path(__file__).parent / 'apache_pytest')]
+sys.modules['apache_pytest'] = pkg
+
+probe = types.ModuleType('apache_pytest.probe')
+
+class _HttpdInfo:
+    pass
+
+probe.HttpdInfo = _HttpdInfo
+sys.modules['apache_pytest.probe'] = probe
+
+from apache_pytest.cmodules import generate_header  # noqa: E402
+
+if __name__ == '__main__':
+    if len(sys.argv) > 1:
+        dest = Path(sys.argv[1])
+    else:
+        dest = Path(__file__).parent / 'c-modules' / 'apache_httpd_test.h'
+    generate_header(dest)

Copied and modified: httpd/httpd/branches/2.4.x/test/pytest_suite/runtests.bat (from r1937083, httpd/httpd/trunk/test/pytest_suite/runtests.bat)
==============================================================================
--- httpd/httpd/trunk/test/pytest_suite/runtests.bat	Wed Aug 12 15:48:30 2026	(r1937083, copy source)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/runtests.bat	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -7,15 +7,17 @@ rem Apache httpd (the server under test)
 rem optionally a php-fpm binary to run the PHP tests.
 rem
 rem Usage:
-rem   runtests.bat                       -- auto-detect apxs/httpd/php-fpm on PATH
-rem   runtests.bat --apxs C:\path\apxs   -- point at a specific build
-rem   runtests.bat tests\t\modules       -- run a subset (any pytest args pass through)
-rem   runtests.bat -k status -v          -- extra pytest args pass through too
+rem   runtests.bat                                -- auto-detect apxs/httpd/php-fpm/perl on PATH
+rem   runtests.bat --apxs C:\path\apxs            -- point at a specific build
+rem   runtests.bat --with-perl C:\path\perl.exe   -- point at a specific perl
+rem   runtests.bat tests\t\modules                -- run a subset (any pytest args pass through)
+rem   runtests.bat -k status -v                   -- extra pytest args pass through too
 rem
 rem Environment overrides (used when the matching --flag is not supplied):
-rem   APXS       path to apxs
-rem   HTTPD      path to httpd
-rem   PHP_FPM    path to php-fpm
+rem   APXS              path to apxs
+rem   HTTPD             path to httpd
+rem   PHP_FPM           path to php-fpm
+rem   APACHE_TEST_PERL  path to perl
 rem
 
 setlocal enabledelayedexpansion
@@ -26,8 +28,21 @@ if "%HERE:~-1%"=="\" set "HERE=%HERE:~0,
 
 cd /d "%HERE%"
 
-rem --- python location
-set PYTHON=%LOCALAPPDATA%\Programs\Python\Python314\python.exe
+rem --- python location: find the newest native Windows Python 3.x
+set PYTHON=
+for /f "delims=" %%D in ('dir /b /o-n "%LOCALAPPDATA%\Programs\Python\Python3*" 2^>nul') do (
+    if not defined PYTHON set "PYTHON=%LOCALAPPDATA%\Programs\Python\%%D\python.exe"
+)
+if not defined PYTHON (
+    for /f "delims=" %%D in ('dir /b /o-n "%PROGRAMFILES%\Python3*" 2^>nul') do (
+        if not defined PYTHON set "PYTHON=%PROGRAMFILES%\%%D\python.exe"
+    )
+)
+if not defined PYTHON (
+    echo runtests.bat: ERROR: Python interpreter not found. >&2
+    echo   Install Python from https://www.python.org or set PYTHON=... >&2
+    exit /b 1
+)
 
 rem --- ensure the venv exists and is current ----------------------------------
 set "PYTEST=%HERE%\.venv\Scripts\pytest.exe"
@@ -81,6 +96,14 @@ if not defined PHP_FPM (
     )
 )
 
+if not defined APACHE_TEST_PERL (
+    for %%C in (perl.exe) do (
+        for /f "delims=" %%P in ('where %%C 2^>nul') do (
+            if "!APACHE_TEST_PERL!"=="" set "APACHE_TEST_PERL=%%P"
+        )
+    )
+)
+
 rem Build the default flag set only for values the user did not pass explicitly.
 set "AUTO_ARGS="
 
@@ -117,6 +140,21 @@ if "%HAS_PHP_FLAG%"=="0" (
     )
 )
 
+rem Check if user passed --with-perl on the command line.
+set "HAS_PERL_FLAG=0"
+for %%A in (%*) do (
+    echo %%A | findstr /b /c:"--with-perl" >nul 2>&1 && set "HAS_PERL_FLAG=1"
+)
+
+if "%HAS_PERL_FLAG%"=="0" (
+    if defined APACHE_TEST_PERL (
+        set "AUTO_ARGS=!AUTO_ARGS! --with-perl=!APACHE_TEST_PERL!"
+    ) else (
+        echo runtests.bat: note: no perl found; rewrite prg-map tests may fail. >&2
+        echo   Pass --with-perl=C:\path\to\perl.exe or set APACHE_TEST_PERL=... >&2
+    )
+)
+
 rem A stale mod_cgid socket in t\logs can break a fresh run; clear it first.
 del /q "%HERE%\t\logs\cgisock*" 2>nul
 

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/cache.conf.in
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/cache.conf.in	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/cache.conf.in	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -7,7 +7,7 @@
     <IfModule mod_disk_cache.c>
 
             CacheEnable    disk /cache/
-            CacheRoot      @SERVERROOT@/conf/cacheroot/ 
+            CacheRoot      @STATEDIR@/cacheroot/
             CacheDirLevels 1
             CacheDirLength 1
 
@@ -15,7 +15,7 @@
    <IfModule mod_cache_disk.c>
 
             CacheEnable    disk /cache/
-            CacheRoot      @SERVERROOT@/conf/cacheroot/ 
+            CacheRoot      @STATEDIR@/cacheroot/
             CacheDirLevels 1
             CacheDirLength 1
 

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/extra.conf.in
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/extra.conf.in	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/t/conf/extra.conf.in	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -178,7 +178,7 @@
     RewriteMap numbers-txt txt:@SERVERROOT@/htdocs/modules/rewrite/numbers.txt
     RewriteMap numbers-rnd rnd:@SERVERROOT@/htdocs/modules/rewrite/numbers.rnd
     #RewriteMap numbers-dbm dbm:@SERVERROOT@/htdocs/modules/rewrite/numbers.dbm
-    RewriteMap numbers-prg prg:@SERVERROOT@/htdocs/modules/rewrite/numbers.pl
+    RewriteMap numbers-prg "prg:@PERL@ @SERVERROOT@/htdocs/modules/rewrite/numbers.pl"
     RewriteMap lower int:tolower
 
     <Directory @SERVERROOT@/htdocs/modules/rewrite>
@@ -358,6 +358,7 @@
    </VirtualHost>
 
    # PR60478: pathological rewrite expansion
+   <IfModule mod_test_utilities.c>
    <IfVersion >= 2.4>
    <Location /modules/rewrite/pr60478-rewrite-loop>
       # This pair of RewriteRules will loop but should eventually 500 once we
@@ -368,6 +369,7 @@
       RewriteRule X - [N]
    </Location>
    </IfVersion>
+   </IfModule>
 
 </IfModule>
 

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/cgi/nph-foldhdr.pl.PL
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/cgi/nph-foldhdr.pl.PL	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/t/htdocs/modules/cgi/nph-foldhdr.pl.PL	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -1,5 +1,6 @@
 # produces output with folded response headers
 
+binmode(STDOUT);
 print "HTTP/1.0 200 OK\r\n";
 
 for (1..50) {

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ab/test_base.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ab/test_base.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ab/test_base.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -18,7 +18,10 @@ import pytest
 
 
 def _ab_path(http) -> Path:
-    return Path(http.config.info.httpd).resolve().parent / "ab"
+    ab = Path(http.config.info.httpd).parent / "ab"
+    if not ab.exists() and ab.with_suffix(".exe").exists():
+        return ab.with_suffix(".exe")
+    return ab
 
 
 def _run_ab(ab: Path, url: str) -> subprocess.CompletedProcess:

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_acceptpathinfo.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_acceptpathinfo.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_acceptpathinfo.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -8,6 +8,7 @@ Perl original needed: need_apache(2), mo
 """
 
 import re
+import sys
 
 import pytest
 
@@ -60,6 +61,8 @@ def _cases(http):
 @need_lwp()
 def test_acceptpathinfo(http):
     for mode, req, exp_rc, exp_body in _cases(http):
+        if "/test.sh" in req and sys.platform == "win32":
+            continue
         # Apache::TestRequest's GET follows redirects by default; the bare
         # directory request 301-redirects to add a trailing slash before the
         # index.shtml (which echoes PATH_INFO) is served.

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_byterange2.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_byterange2.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_byterange2.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -13,4 +13,4 @@ from apache_pytest import need_cgi, need
 @need_cgi()
 def test_byterange2(http):
     resp = http.GET_BODY("/modules/cgi/ranged.pl", headers={"Range": "bytes=5-10/10"})
-    assert t_cmp(resp, "hello\n"), "return correct content"
+    assert t_cmp(resp.replace("\r\n", "\n"), "hello\n"), "return correct content"

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_mmn.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_mmn.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_mmn.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -20,11 +20,14 @@ _MINOR = re.compile(r"^#define\s+MODULE_
 @need_min_apache_version("2")
 def test_mmn(http):
     incdir = http.apxs("INCLUDEDIR")
-    if not incdir:
-        pytest.skip("apxs INCLUDEDIR unavailable")
-    filename = os.path.join(incdir, "ap_mmn.h")
-    if not os.path.isfile(filename):
-        pytest.skip(f"can't read {filename}")
+    filename = os.path.join(incdir, "ap_mmn.h") if incdir else None
+    if not filename or not os.path.isfile(filename):
+        # Fall back to the source tree include/ directory.
+        src_inc = os.path.join(http.vars("top_dir"), "..", "..", "include", "ap_mmn.h")
+        if os.path.isfile(src_inc):
+            filename = src_inc
+        else:
+            pytest.skip("ap_mmn.h not found (no apxs and not in source tree)")
 
     cmajor = cminor = major = minor = None
     with open(filename) as fh:

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr37166.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr37166.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr37166.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -15,10 +15,11 @@ URI = "/modules/cgi/pr37166.pl"
 def test_pr37166(http):
     r = http.GET(URI)
     assert t_cmp(r.status_code, 200), "SSI was allowed for location"
-    assert t_cmp(r.text, "Hello world\n"), "file was served with correct content"
+    assert t_cmp(r.text.replace("\r\n", "\n"), "Hello world\n"), \
+        "file was served with correct content"
 
     r = http.GET(URI, headers={"If-Modified-Since": "Tue, 15 Feb 2005 15:00:00 GMT"})
     assert t_cmp(r.status_code, 200), "explicit 200 response"
-    assert t_cmp(r.text, "Hello world\n"), (
+    assert t_cmp(r.text.replace("\r\n", "\n"), "Hello world\n"), (
         "file was again served with correct content"
     )

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr49328.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr49328.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/apache/test_pr49328.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -12,7 +12,7 @@ INFLATOR = "/modules/deflate/echo_post"
 URI = "/modules/filter/pr49328/pr49328.shtml"
 
 
-@need_module("filter", "include", "deflate")
+@need_module("filter", "include", "deflate", "echo_post")
 def test_pr49328(http):
     # GET_RAW: keep the gzip stream undecoded so we can re-POST it through the
     # inflate input filter (httpx would otherwise auto-decompress .content).
@@ -20,4 +20,4 @@ def test_pr49328(http):
     deflated = http.POST_BODY(
         INFLATOR, content=content, headers={"Content-Encoding": "gzip"}
     )
-    assert t_cmp(deflated, "before\nincluded\nafter\n")
+    assert t_cmp(deflated.replace("\r\n", "\n"), "before\nincluded\nafter\n")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_access.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_access.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_access.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -6,12 +6,12 @@ served (GET_OK, i.e. 200) per the access
 
 Perl original gated on ``\&need_access`` (the Order/Allow/Deny directives live
 in mod_access_compat on 2.4); gated here with @need_module.
-
-Note: the Perl framework exposes vars->{remote_addr}; the Python config does
-not (framework-API gap), so we fall back to the loopback 127.0.0.1 the test
-server actually connects from.
 """
 
+import sys
+
+import pytest
+
 from apache_pytest import need_module
 
 ORDERS = ["deny,allow", "allow,deny", "mutual-failure"]
@@ -55,6 +55,8 @@ def _write_htaccess(http, conf):
         f.write(conf)
 
 
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="dual-stack localhost makes Allow/Deny unreliable")
 @need_module("mod_access_compat")
 def test_access(http):
     clauses, addr1, localhost_name = _localhost_clauses(http)

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_actions.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_actions.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_actions.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -4,6 +4,8 @@ Two groups: ``tests_action`` (GET each u
 ``tests_script`` (GET, POST and PUT against script locations).
 """
 
+import sys
+
 import pytest
 
 from apache_pytest import need_module, t_cmp
@@ -35,6 +37,8 @@ TESTS_SCRIPT = [
 def test_actions_action(http, case):
     if case in TESTS_ACTION_2460 and not http.have_min_apache_version("2.4.60"):
         pytest.skip("requires httpd >= 2.4.60")
+    if sys.platform == "win32" and (".sh?" in case[0] or case[0].endswith(".sh")):
+        pytest.skip("shell scripts not available on Windows")
     url, code = case[0], case[1]
     r = http.GET(url)
     assert t_cmp(r.status_code, code), f"Check {url} for {code}"
@@ -53,7 +57,7 @@ def test_actions_script(http, case):
 
     r = http.POST(url, content="foo2=bar2")
     assert t_cmp(r.status_code, 200)
-    assert t_cmp(r.text, "POST\nfoo2: bar2\n")
+    assert t_cmp(r.text.replace("\r\n", "\n"), "POST\nfoo2: bar2\n")
 
     # Method not allowed
     r = http.PUT(url, content="foo2=bar2")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_alias.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_alias.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_alias.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -13,6 +13,7 @@ WINFU (Windows) branches are not reprodu
 import os
 import re
 import stat
+import sys
 
 import pytest
 
@@ -133,19 +134,22 @@ def test_scriptalias(http):
     _write_cgi(http)
 
     # Served as plain text at /modules/alias/script.
-    assert t_cmp(http.GET_BODY("/modules/alias/script"), CGI), \
-        "/modules/alias/script"
+    body = http.GET_BODY("/modules/alias/script").replace("\r\n", "\n")
+    assert t_cmp(body, CGI), "/modules/alias/script"
 
     if http.have_module("mod_cgi") or http.have_module("mod_cgid"):
+        if sys.platform == "win32":
+            pytest.skip("shell CGI scripts not available on Windows")
         # Executed as CGI at /cgi/script.
-        assert t_cmp(http.GET_BODY("/cgi/script"), f"{CGI_STRING}\n"), "/cgi/script"
+        body = http.GET_BODY("/cgi/script").replace("\r\n", "\n")
+        assert t_cmp(body, f"{CGI_STRING}\n"), "/cgi/script"
         # ScriptAliasMatch.
-        assert t_cmp(http.GET_BODY("/aliascgi-script"), f"{CGI_STRING}\n"), \
-            "/aliascgi-script"
+        body = http.GET_BODY("/aliascgi-script").replace("\r\n", "\n")
+        assert t_cmp(body, f"{CGI_STRING}\n"), "/aliascgi-script"
         if http.have_min_apache_version("2.4.19"):
             # ScriptAlias inside LocationMatch.
-            assert t_cmp(http.GET_BODY("/expr/aliascgi-script"),
-                         f"{CGI_STRING}\n"), "/aliascgi-script"
+            body = http.GET_BODY("/expr/aliascgi-script").replace("\r\n", "\n")
+            assert t_cmp(body, f"{CGI_STRING}\n"), "/aliascgi-script"
 
     # Bad ScriptAliasMatch.
     assert t_cmp(http.GET_RC("/aliascgi-nada"), 404), "/aliascgi-nada"

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_authz_core.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_authz_core.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_authz_core.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -21,9 +21,9 @@ import httpx
 from apache_pytest import need_min_apache_version, need_module
 
 BASIC1 = (
-    "user1:NYSYdf7MU5KpU\n"
-    "user2:KJ7Yxzr1VVzAI\n"
-    "user3:xnpSvZ2iqti/c\n"
+    "user1:$apr1$1Yd.TmyR$s/gcvsI8Ikrgqy6w0fyQW1\n"
+    "user2:$apr1$YOeJr2Nf$.4bJ1bv6ndkOj1ilkaz76/\n"
+    "user3:$apr1$5ygaekD5$XbW3dLYcBJ6KF09QMR9ol0\n"
 )
 GROUPS1 = (
     "user1:user1\n"

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cache.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cache.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cache.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -18,7 +18,7 @@ from apache_pytest import need_min_apach
 def test_cache(http):
     http.module("mod_cache")
 
-    cacheroot = os.path.join(http.vars("serverroot"), "conf", "cacheroot")
+    cacheroot = os.path.join(http.vars("statedir"), "cacheroot")
     os.makedirs(cacheroot, exist_ok=True)
 
     r = http.GET("/cache/")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cgi.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cgi.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_cgi.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -11,6 +11,7 @@ Perl original: plan tests => ..., \&need
 
 import os
 import re
+import sys
 
 import pytest
 
@@ -47,6 +48,7 @@ def _cgi_log(http):
 
 
 @need_cgi()
+@pytest.mark.skipif(sys.platform == "win32", reason="shell CGI scripts not available on Windows")
 def test_cgi(http):
     cgi_log = _cgi_log(http)
     if os.path.exists(cgi_log):

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_ext_filter.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_ext_filter.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_ext_filter.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -9,12 +9,19 @@ keep-alive UA.
 """
 
 import re
+import sys
 
 import pytest
 
 from apache_pytest import need_cgi, need_module, t_cmp
 
+_skip_win32 = pytest.mark.skipif(
+    sys.platform == "win32",
+    reason="ext_filter cmd cannot execute .pl scripts directly on Windows",
+)
 
+
+@_skip_win32
 @need_module("ext_filter")
 @need_cgi()
 def test_ext_filter_output(http):
@@ -22,6 +29,7 @@ def test_ext_filter_output(http):
     assert t_cmp(content, "barbar"), "sed output filter"
 
 
+@_skip_win32
 @need_module("ext_filter")
 @need_cgi()
 def test_ext_filter_slow(http):
@@ -29,6 +37,7 @@ def test_ext_filter_slow(http):
     assert t_cmp(content, "foobar"), "slow filter process"
 
 
+@_skip_win32
 @need_module("ext_filter")
 @need_cgi()
 def test_ext_filter_input(http):

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_include.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_include.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_include.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -13,6 +13,7 @@ Perl original: plan tests => ..., need '
 import os
 import re
 import stat
+import sys
 
 import pytest
 
@@ -149,6 +150,8 @@ def test_include_pages(http):
 
     for doc in sorted(tests):
         expected = tests[doc]
+        if sys.platform == "win32" and doc.startswith("exec/on/cmd"):
+            continue
         if isinstance(expected, tuple):
             body, host = expected
             got = super_chomp(http.GET_BODY(f"{DIR}{doc}", headers={"Host": host}))
@@ -234,6 +237,7 @@ def _check_xbithack_etag(resp):
 
 
 @need_module("include")
+@pytest.mark.skipif(sys.platform == "win32", reason="XBitHack relies on Unix file permission bits")
 def test_include_xbithack(http):
     http.scheme("http")
     http.module("mod_include")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_negotiation.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_negotiation.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_negotiation.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -137,7 +137,7 @@ def test_quality_preferences(http):
 @need_cgi()
 def test_query_typemap(http):
     actual = _chomp(http.GET_BODY("/modules/negotiation/query/test?foo"))
-    assert t_cmp(actual, "QUERY_STRING --> foo"), \
+    assert t_cmp(actual.replace("\r", ""), "QUERY_STRING --> foo"), \
         "The type map gives the script the highest quality; query string included"
 
 

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -13,6 +13,7 @@ Perl original: plan tests => 46, need ne
 import os
 import re
 import socket
+import sys
 import threading
 import time
 
@@ -87,14 +88,15 @@ def test_proxy_cgi(http):
 
         r = http.GET("/reverse/modules/cgi/env.pl?reverse-proxy")
         assert t_cmp(r.status_code, 200), "reverse proxy with query string"
-        assert t_cmp(r.text, re.compile(r"QUERY_STRING = reverse-proxy\n", re.S)), \
+        assert t_cmp(r.text, re.compile(r"QUERY_STRING = reverse-proxy\r?\n", re.S)), \
             "reverse proxied query string OK"
 
-        r = http.GET("/reverse/modules/cgi/nph-dripfeed.pl")
-        assert t_cmp(r.status_code, 200), "reverse proxy to dripfeed CGI"
-        assert t_cmp(r.text, "abcdef"), "reverse proxied to dripfeed CGI content OK"
+        if sys.platform != "win32":
+            r = http.GET("/reverse/modules/cgi/nph-dripfeed.pl")
+            assert t_cmp(r.status_code, 200), "reverse proxy to dripfeed CGI"
+            assert t_cmp(r.text, "abcdef"), "reverse proxied to dripfeed CGI content OK"
 
-        if http.have_min_apache_version("2.1.0"):
+        if http.have_min_apache_version("2.1.0") and sys.platform != "win32":
             # nph-102.pl emits a 102 Processing interim response then a 200.
             # The Perl test asserted the LWP-surfaced code 102 (empty body) and
             # noted LWP needed fixing for 1xx. httpx correctly consumes the
@@ -187,6 +189,7 @@ def test_proxy_redirect_rewrite(http):
 
 
 @need_module("proxy", "setenvif")
+@pytest.mark.skipif(sys.platform == "win32", reason="AF_UNIX not available on Windows")
 def test_proxy_uds(http):
     if not http.have_min_apache_version("2.4.7"):
         pytest.skip("UDS requires httpd >= 2.4.7")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_beacon.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_beacon.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_beacon.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -68,6 +68,19 @@ def test_proxy_beacon(http):
         fh.seek(start)
         loglines = fh.read().splitlines()
 
+    # "added backend" is logged once ever per url for the life of the
+    # (session-scoped) httpd process -- it dedups via ctx->seen in
+    # mod_proxy_beacon (beacon_try_add()/beacon_handle_announce()). Since this
+    # test may run long after server startup, that one-time event can predate
+    # `start` and must be searched for since session start instead. Do NOT
+    # scan from byte 0 of error_log: t_logs/ isn't cleaned between separate
+    # test runs, so the file can carry "added backend" lines from earlier,
+    # unrelated httpd sessions (different pids, possibly hours old).
+    session_start = int(http.vars("session_log_start") or 0)
+    with error_log.open("r", errors="replace") as fh:
+        fh.seek(session_start)
+        session_loglines = fh.read().splitlines()
+
     # Announcements are received and carry a routable url=.
     received = [ln for ln in loglines if "received: BEACON" in ln]
     assert received, "no announcements received by the SUB"
@@ -77,7 +90,7 @@ def test_proxy_beacon(http):
     # Phase 2: the backend was added exactly once (dedup), no add-failure spam.
     # Qualify by balancer://beacon so the capacity-test balancer (below) doesn't
     # perturb these counts.
-    added = [ln for ln in loglines
+    added = [ln for ln in session_loglines
              if "added backend" in ln and "balancer://beacon" in ln]
     assert len(added) == 1, (
         f"backend should be added exactly once; saw {len(added)}: {added}")
@@ -103,7 +116,9 @@ def test_proxy_beacon(http):
 
     # Slot exhaustion: balancer://cap has room for one member but two backends
     # announce to it. Exactly one must be added; the other can never fit.
-    cap_added = [ln for ln in loglines
+    # Same one-time-dedup-event caveat as the balancer://beacon "added" check
+    # above: search since session start, not just this test's window.
+    cap_added = [ln for ln in session_loglines
                  if "added backend" in ln and "balancer://cap" in ln]
     assert len(cap_added) == 1, (
         f"exactly one backend should fit balancer://cap; saw: {cap_added}")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_fcgi.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_fcgi.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_proxy_fcgi.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -22,6 +22,7 @@ import os
 import re
 import socket
 import struct
+import sys
 import threading
 
 import pytest
@@ -181,6 +182,8 @@ def _run_echo_request(http, address, uri
     return r, envs
 
 
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="mod_proxy_fcgi misparses drive-letter paths as port")
 @need_module("proxy_fcgi")
 def test_fcgi_setenvif(http):
     if not http.have_min_apache_version("2.4.26"):
@@ -203,6 +206,8 @@ def test_fcgi_setenvif(http):
     assert t_cmp(envs.get("REMOTE_ADDR"), None), "ProxyFCGISetEnvIf can unset var"
 
 
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="mod_proxy_fcgi misparses drive-letter paths as port")
 @need_module("proxy_fcgi")
 def test_fcgi_generic(http):
     if not http.have_min_apache_version("2.4.26"):
@@ -217,6 +222,8 @@ def test_fcgi_generic(http):
         "GENERIC SCRIPT_FILENAME has neither query string nor proxy: prefix"
 
 
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="mod_proxy_fcgi misparses drive-letter paths as port")
 @need_module("proxy_fcgi")
 def test_fcgi_generic_rewrite(http):
     if not (http.have_min_apache_version("2.4.26") and http.have_module("rewrite")):
@@ -232,6 +239,8 @@ def test_fcgi_generic_rewrite(http):
         "GENERIC SCRIPT_FILENAME (rewrite) is correct"
 
 
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="mod_proxy_fcgi misparses drive-letter paths as port")
 @need_module("proxy_fcgi")
 def test_fcgi_rewrite_path_info(http):
     if not http.have_module("rewrite"):
@@ -258,6 +267,8 @@ def test_fcgi_rewrite_path_info(http):
         "Default REDIRECT_URL uses original client URL"
 
 
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="mod_proxy_fcgi misparses drive-letter paths as port")
 @need_module("proxy_fcgi")
 def test_fcgi_action(http):
     if not http.have_module("actions"):
@@ -286,6 +297,8 @@ def test_fcgi_action(http):
         "Action REDIRECT_URL uses original client URL"
 
 
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="mod_proxy_fcgi misparses drive-letter paths as port")
 @need_module("proxy_fcgi")
 def test_fcgi_default(http):
     http.module("proxy_fcgi")
@@ -297,6 +310,7 @@ def test_fcgi_default(http):
 
 
 @need_module("proxy_fcgi")
+@pytest.mark.skipif(sys.platform == "win32", reason="AF_UNIX not available on Windows")
 @pytest.mark.parametrize("url", [
     "/modules/proxy/fcgi-uds/index.php",
     "/modules/proxy/fcgi-uds-sethandler/index.php",

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_rewrite.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_rewrite.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_rewrite.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -10,6 +10,7 @@ Perl original: plan tests => ..., todo =
 """
 
 import re
+import sys
 
 import pytest
 
@@ -53,8 +54,8 @@ def test_rewrite_special_accepts(http):
 
 @need_module("rewrite")
 def test_rewrite_qsa(http):
-    r = http.GET_BODY("/modules/rewrite/qsa.html?baz=bee").rstrip("\n")
-    assert t_cmp(r, re.compile(r"\nQUERY_STRING = foo=bar&baz=bee\n", re.S)), \
+    r = http.GET_BODY("/modules/rewrite/qsa.html?baz=bee").rstrip("\r\n")
+    assert t_cmp(r, re.compile(r"\r?\nQUERY_STRING = foo=bar&baz=bee\r?\n", re.S)), \
         "query-string append test"
 
 
@@ -88,24 +89,24 @@ def test_rewrite_to_proxy(http):
 def test_rewrite_proxy_query_string(http):
     if not (_have_proxy(http) and _have_cgi(http)):
         pytest.skip("missing proxy or CGI module")
-    r = http.GET_BODY("/modules/rewrite/proxy2/env.pl?fish=fowl").rstrip("\n")
-    assert t_cmp(r, re.compile(r"QUERY_STRING = fish=fowl\n", re.S)), \
+    r = http.GET_BODY("/modules/rewrite/proxy2/env.pl?fish=fowl").rstrip("\r\n")
+    assert t_cmp(r, re.compile(r"QUERY_STRING = fish=fowl\r?\n", re.S)), \
         "QUERY_STRING passed OK"
 
     assert t_cmp(http.GET_RC("/modules/rewrite/proxy3/env.pl?horse=norman"), 404), \
         "RewriteCond QUERY_STRING test"
 
-    r = http.GET_BODY("/modules/rewrite/proxy3/env.pl?horse=trigger").rstrip("\n")
-    assert t_cmp(r, re.compile(r"QUERY_STRING = horse=trigger\n", re.S)), \
+    r = http.GET_BODY("/modules/rewrite/proxy3/env.pl?horse=trigger").rstrip("\r\n")
+    assert t_cmp(r, re.compile(r"QUERY_STRING = horse=trigger\r?\n", re.S)), \
         "QUERY_STRING passed OK"
 
     r = http.GET("/modules/rewrite/proxy-qsa.html?bloo=blar")
     assert t_cmp(r.status_code, 200), "proxy/QSA test success"
-    assert t_cmp(r.text, re.compile(r"QUERY_STRING = foo=bar&bloo=blar\n", re.S)), \
+    assert t_cmp(r.text, re.compile(r"QUERY_STRING = foo=bar&bloo=blar\r?\n", re.S)), \
         "proxy/QSA test appended args correctly"
 
 
-@need_module("rewrite")
+@need_module("rewrite", "test_utilities")
 def test_rewrite_pr60478(http):
     if not http.have_min_apache_version("2.4"):
         pytest.skip("PR 60478 requires ap_expr in version 2.4")
@@ -301,6 +302,8 @@ def _prefixstats(http):
 
 
 @need_module("rewrite")
+@pytest.mark.skipif(sys.platform == "win32",
+                    reason="Windows drive-letter colons in paths cause 400 Bad Request")
 def test_rewrite_prefixstat(http):
     # Uses the rewrite_prefix_stat vhost (larger LimitRequestLine).
     http.module("rewrite_prefix_stat")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_sed.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_sed.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_sed.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -28,7 +28,7 @@ CASES = [
 ]
 
 
-@need_module("sed")
+@need_module("sed", "echo_post")
 @pytest.mark.parametrize("case", CASES, ids=[c["url"] for c in CASES])
 def test_sed(http, case):
     if case["body"] is not None:

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_session.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_session.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_session.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -105,7 +105,7 @@ CREATE_SESSION = "action=set&name=test&v
 READ_SESSION = "action=get&name=test"
 
 
-@need_module("session")
+@need_module("session", "test_session")
 @need_min_apache_version("2.3.0")
 def test_session(http):
     # Session directive

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_speling.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_speling.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_speling.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -32,8 +32,8 @@ TESTCASES = [
     ("several0.html", "multiple choice", 300, 404),
 ]
 
-# macOS HFS is case-insensitive but case-preserving, so this would mislead.
-if sys.platform != "darwin":
+# macOS HFS and Windows NTFS are case-insensitive, so this would mislead.
+if sys.platform not in ("darwin", "win32"):
     TESTCASES.append(("GOOD.html", "case", 301, 301))
 
 # (path-prefix, index into the case tuple for the expected status)

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_substitute.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_substitute.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_substitute.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -68,16 +68,16 @@ def _docroot_file(http, *parts):
 
 
 def _write_testfile(http, content):
-    with open(_docroot_file(http, "test.txt"), "w") as f:
-        f.write(content)
+    with open(_docroot_file(http, "test.txt"), "wb") as f:
+        f.write(content.encode("utf-8"))
 
 
 def _write_htaccess(http, rules):
     content = "SetOutputFilter BUCKETEER;SUBSTITUTE\n"
     for rule in rules:
         content += f"Substitute {rule}\n"
-    with open(_docroot_file(http, ".htaccess"), "w") as f:
-        f.write(content)
+    with open(_docroot_file(http, ".htaccess"), "wb") as f:
+        f.write(content.encode("utf-8"))
 
 
 def _httpd_rule_to_python(content, rule):

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_vhost_alias.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_vhost_alias.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/modules/test_vhost_alias.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -11,6 +11,7 @@ selected the mod_vhost_alias vhost port;
 
 import os
 import stat
+import sys
 
 import pytest
 
@@ -83,6 +84,7 @@ def _setup(root):
 
 @need_module("vhost_alias")
 @need_cgi()
+@pytest.mark.skipif(sys.platform == "win32", reason="uses shell CGI scripts")
 @pytest.mark.parametrize("vh", VHOSTS)
 def test_vhost_alias(http, vh):
     root = os.path.join(http.vars("documentroot"), "modules", "vhost_alias")

Modified: httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ssl/test_pr43738.py
==============================================================================
--- httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ssl/test_pr43738.py	Mon Sep 28 16:16:58 2026	(r1938620)
+++ httpd/httpd/branches/2.4.x/test/pytest_suite/tests/t/ssl/test_pr43738.py	Mon Sep 28 16:36:07 2026	(r1938621)
@@ -22,4 +22,5 @@ def test_pr43738(http):
     for path in ("/modules/ssl/aes128/empty.pfa", "/modules/ssl/aes256/empty.pfa"):
         r = http.POST(path, content="hello world")
         assert t_cmp(r.status_code, 200), "renegotiation on POST works"
-        assert t_cmp(r.text, f"{path}\nhello world"), "request body matches response"
+        assert t_cmp(r.text.replace("\r\n", "\n"), f"{path}\nhello world"), \
+            "request body matches response"