Run the SFTP regression tests on Windows under MSYS2

tests/regress.c holds the only coverage for the Windows SFTP open path,
including TestSftpWindowsOpenFlagMatrix, which walks the RecvOpen
CREAT/EXCL/TRUNC/APPEND matrix against the CreateFile() disposition
table. That test is guarded by USE_WINDOWS_API and ran in no CI job. The
MSVC solution in ide/winvs has no regress project, and regress.c does not
build with cl because it includes arpa/inet.h and unistd.h, so the
disposition fix it locks down could regress unnoticed.

Add an MSYS2 MinGW64 job to the Windows workflow. MinGW defines _WIN32,
so wolfssh/settings.h turns on USE_WINDOWS_API and the Windows-only
branches compile and run. The job builds wolfSSL static, configures
wolfSSH with --enable-sftp, and runs tests/regress.test and
tests/unit.test. wolfsshd is left out: its autotools path is not
MinGW-clean and the MSVC solution already covers it.
pull/1247/head
Hideki Miyazaki 2026-09-03 07:24:22 -04:00 committed by John Safranek
parent 4553b3c659
commit ea30c9fd9d
1 changed files with 68 additions and 0 deletions

View File

@ -220,3 +220,71 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "$t failed under ASAN (exit $LASTEXITCODE)" }
}
# Build and run the autotools regression tests under MSYS2 MinGW64. MinGW
# defines _WIN32, so wolfssh/settings.h turns on USE_WINDOWS_API and the
# Windows-only coverage in tests/regress.c (TestSftpWindowsOpenFlagMatrix,
# which walks the RecvOpen CREAT/EXCL/TRUNC/APPEND matrix against the
# CreateFile() disposition table) actually compiles and runs. The MSVC
# solution has no regress project and regress.c does not build with cl (it
# uses arpa/inet.h and unistd.h), so without this job that matrix runs in no
# CI at all. wolfsshd is left out of the build: its autotools path is not
# MinGW-clean and the MSVC solution already covers it.
mingw-regress:
name: MSYS2 MinGW64 regression tests
runs-on: windows-latest
timeout-minutes: 40
defaults:
run:
shell: msys2 {0}
steps:
- name: Set up MSYS2 MinGW64
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
base-devel
autotools
git
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkgconf
- name: Checkout wolfssl
uses: actions/checkout@v4
with:
repository: wolfssl/wolfssl
path: wolfssl
- name: Build and install wolfssl
working-directory: wolfssl
run: |
./autogen.sh
# --enable-all pulls in --enable-crl-monitor, which wolfSSL's configure
# rejects on MinGW (it is limited to linux, OS X, and freebsd). Turn it
# back off explicitly; wolfSSH does not use the CRL monitor.
./configure --enable-all --disable-crl-monitor \
--enable-static --disable-shared \
--prefix="$HOME/wolfssl-install"
make -j$(nproc)
make install
- name: Checkout wolfssh
uses: actions/checkout@v4
with:
path: wolfssh
- name: Build and run the regression tests
working-directory: wolfssh
run: |
# Run autoreconf directly instead of ./autogen.sh: for a git checkout
# autogen.sh exports WARNINGS="all,error", turning autotools warnings
# into errors that the MSYS2 automake can trip on.
autoreconf -ivf
./configure --enable-sftp \
CPPFLAGS="-I$HOME/wolfssl-install/include" \
LDFLAGS="-L$HOME/wolfssl-install/lib"
make -j$(nproc) tests/regress.test tests/unit.test
./tests/regress.test
./tests/unit.test