@@ -318,16 +318,15 @@ jobs:
318318 }
319319 Write-Host "Basic SFTP test passed"
320320
321- - name : Create 3GB test file and run SFTP get/put (large_rw)
322- if : matrix.test_type == 'large_rw'
321+ - name : Create 3GB test file and run SFTP get/put
323322 working-directory : ${{ github.workspace }}\wolfssh
324323 shell : pwsh
325324 timeout-minutes : 25
326325 run : |
327326 $sftpPath = $env:SFTP_PATH
328- $workDir = (Get-Location). Path
327+ $workDir = Join- Path $env:GITHUB_WORKSPACE "wolfssh"
329328 $largeFile = Join-Path $workDir "large_test.dat"
330- $getDest = Join-Path $workDir "large_test_copy.dat"
329+ $getDestPath = Join-Path $workDir "large_test_copy.dat"
331330
332331 # Create 3GB file: one random 10MB chunk repeated 307x + 2MB
333332 Write-Host "Creating 3GB test file..."
@@ -346,57 +345,61 @@ jobs:
346345 $fs.Close()
347346
348347 $hash = Get-FileHash -Path $largeFile -Algorithm SHA256
349- $hash.Hash | Out-File -FilePath large_test.dat.sha256
348+ $hash.Hash | Out-File -FilePath (Join-Path $workDir " large_test.dat.sha256")
350349 Write-Host "Created 3GB file, SHA256: $($hash.Hash)"
351350
352351 # SFTP PUT (upload)
353352 Write-Host "SFTP PUT 3GB file..."
354353 $putCommands = "put $largeFile /large_test.dat`nquit"
355- $putCommands | Out-File -FilePath sftp_put_commands.txt -Encoding ASCII
354+ $putCommands | Out-File -FilePath (Join-Path $workDir " sftp_put_commands.txt") -Encoding ASCII
356355 $proc = Start-Process -FilePath $sftpPath `
357356 -ArgumentList "-u", "testuser", "-P", $env:TESTUSER_PASSWORD, "-h", "localhost", "-p", "${{env.TEST_PORT}}" `
358- -RedirectStandardInput "sftp_put_commands.txt" `
359- -RedirectStandardOutput "sftp_put_out.txt" `
360- -RedirectStandardError "sftp_put_err.txt" `
357+ -WorkingDirectory $workDir `
358+ -RedirectStandardInput (Join-Path $workDir "sftp_put_commands.txt") `
359+ -RedirectStandardOutput (Join-Path $workDir "sftp_put_out.txt") `
360+ -RedirectStandardError (Join-Path $workDir "sftp_put_err.txt") `
361361 -Wait -NoNewWindow -PassThru
362362
363363 if ($proc.ExitCode -ne 0) {
364- Get-Content sftp_put_out.txt
365- Get-Content sftp_put_err.txt
364+ Get-Content (Join-Path $workDir " sftp_put_out.txt")
365+ Get-Content (Join-Path $workDir " sftp_put_err.txt")
366366 Write-Host "ERROR: SFTP PUT failed"
367367 exit 1
368368 }
369369 Write-Host "PUT succeeded"
370370
371- # SFTP GET (download)
371+ # SFTP GET (download) - use full path so file lands in known location
372+ # Use forward slashes for SFTP client (avoids backslash parsing in command)
372373 Write-Host "SFTP GET 3GB file..."
373- $getCommands = "get /large_test.dat $getDest`nquit"
374- $getCommands | Out-File -FilePath sftp_get_commands.txt -Encoding ASCII
374+ $getDestPathSftp = $getDestPath -replace '\\', '/'
375+ $getCommands = "get /large_test.dat $getDestPathSftp`nquit"
376+ $getCommands | Out-File -FilePath (Join-Path $workDir "sftp_get_commands.txt") -Encoding ASCII
375377 $proc2 = Start-Process -FilePath $sftpPath `
376378 -ArgumentList "-u", "testuser", "-P", $env:TESTUSER_PASSWORD, "-h", "localhost", "-p", "${{env.TEST_PORT}}" `
377- -RedirectStandardInput "sftp_get_commands.txt" `
378- -RedirectStandardOutput "sftp_get_out.txt" `
379- -RedirectStandardError "sftp_get_err.txt" `
379+ -WorkingDirectory $workDir `
380+ -RedirectStandardInput (Join-Path $workDir "sftp_get_commands.txt") `
381+ -RedirectStandardOutput (Join-Path $workDir "sftp_get_out.txt") `
382+ -RedirectStandardError (Join-Path $workDir "sftp_get_err.txt") `
380383 -Wait -NoNewWindow -PassThru
381384
382385 if ($proc2.ExitCode -ne 0) {
383- Get-Content sftp_get_out.txt
384- Get-Content sftp_get_err.txt
386+ Get-Content (Join-Path $workDir " sftp_get_out.txt")
387+ Get-Content (Join-Path $workDir " sftp_get_err.txt")
385388 Write-Host "ERROR: SFTP GET failed"
386389 exit 1
387390 }
388391 Write-Host "GET succeeded"
389392
390- # Verify integrity
391- $expectedHash = (Get-Content large_test.dat.sha256).Trim()
392- $actualHash = (Get-FileHash -Path $getDest -Algorithm SHA256).Hash
393+ # Verify integrity (file is in $workDir from GET with relative path)
394+ $expectedHash = (Get-Content (Join-Path $workDir " large_test.dat.sha256") ).Trim()
395+ $actualHash = (Get-FileHash -Path $getDestPath -Algorithm SHA256).Hash
393396 if ($expectedHash -ne $actualHash) {
394397 Write-Host "ERROR: SHA256 mismatch - PUT/GET corruption"
395398 Write-Host "Expected: $expectedHash"
396399 Write-Host "Actual: $actualHash"
397400 exit 1
398401 }
399- Write-Host "PASS: 3GB SFTP get/put with WOLFSSH_MAX_SFTP_RW=10485760 succeeded"
402+ Write-Host "PASS: 3GB SFTP get/put succeeded"
400403
401404 - name : Cleanup
402405 if : always()
0 commit comments