@@ -475,6 +475,66 @@ jobs:
475475
476476 Write-Host "Host key configuration verified: OK"
477477
478+ - name : Test wolfSSHd startup (diagnostic)
479+ working-directory : ${{ github.workspace }}\wolfssh
480+ shell : pwsh
481+ run : |
482+ $sshdPath = (Get-Content env:SSHD_PATH)
483+ if (-not (Test-Path $sshdPath)) {
484+ Write-Host "ERROR: wolfsshd.exe not found at $sshdPath"
485+ exit 1
486+ }
487+
488+ $configPath = "sshd_config_test"
489+ if (-not (Test-Path $configPath)) {
490+ Write-Host "ERROR: Config file not found: $configPath"
491+ exit 1
492+ }
493+
494+ Write-Host "=== Testing wolfsshd.exe startup (direct run) ==="
495+ Write-Host "Executable: $sshdPath"
496+ Write-Host "Config: $configPath"
497+
498+ # Try to run it directly to see error messages
499+ $processInfo = New-Object System.Diagnostics.ProcessStartInfo
500+ $processInfo.FileName = $sshdPath
501+ $processInfo.Arguments = "-f $configPath -p ${{env.TEST_PORT}}"
502+ $processInfo.UseShellExecute = $false
503+ $processInfo.RedirectStandardOutput = $true
504+ $processInfo.RedirectStandardError = $true
505+ $processInfo.CreateNoWindow = $true
506+
507+ $process = New-Object System.Diagnostics.Process
508+ $process.StartInfo = $processInfo
509+
510+ try {
511+ $process.Start() | Out-Null
512+ Start-Sleep -Seconds 2
513+
514+ if (-not $process.HasExited) {
515+ Write-Host "Process is running (good sign)"
516+ $process.Kill()
517+ $process.WaitForExit(5000)
518+ } else {
519+ Write-Host "Process exited immediately (exit code: $($process.ExitCode))"
520+ $stdout = $process.StandardOutput.ReadToEnd()
521+ $stderr = $process.StandardError.ReadToEnd()
522+ if ($stdout) {
523+ Write-Host "STDOUT: $stdout"
524+ }
525+ if ($stderr) {
526+ Write-Host "STDERR: $stderr"
527+ }
528+ }
529+ } catch {
530+ Write-Host "ERROR running process: $_"
531+ } finally {
532+ if (-not $process.HasExited) {
533+ $process.Kill()
534+ }
535+ $process.Dispose()
536+ }
537+
478538 - name : Start wolfSSHd as Windows service
479539 working-directory : ${{ github.workspace }}\wolfssh
480540 shell : pwsh
0 commit comments