4242 id : cache-wolfssl
4343 with :
4444 path : build-dir/
45- key : wolfssh-sftp-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
45+ key : wolfssh-sftp-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}-keygen
4646 lookup-only : true
4747
4848 - name : Checkout, build, and install wolfssl
5252 repository : wolfssl/wolfssl
5353 ref : ${{ matrix.wolfssl }}
5454 path : wolfssl
55- configure : --enable-ssh
55+ configure : --enable-ssh --enable-keygen
5656 check : false
5757 install : true
5858
7373 uses : actions/cache@v4
7474 with :
7575 path : build-dir/
76- key : wolfssh-sftp-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
76+ key : wolfssh-sftp-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}-keygen
7777 fail-on-cache-miss : true
7878
7979 - uses : actions/checkout@v4
@@ -124,13 +124,13 @@ jobs:
124124 expect eof
125125 EOF
126126 chmod +x /tmp/sftp_test.exp
127-
127+
128128 # Install expect
129129 sudo apt-get update && sudo apt-get install -y expect
130-
130+
131131 # Run the expect script
132132 /tmp/sftp_test.exp
133-
133+
134134 # Verify the files match
135135 echo "Verifying file integrity..."
136136 if cmp -s /tmp/test.dat /tmp/sftp_test_dir/test_received.dat; then
@@ -139,3 +139,90 @@ jobs:
139139 echo "SFTP Test FAILED: Files do not match"
140140 exit 1
141141 fi
142+
143+ build_wolfssh_large_rw :
144+ needs :
145+ - build_wolfssl
146+ - create_matrix
147+ strategy :
148+ fail-fast : false
149+ matrix :
150+ os : [ ubuntu-latest ]
151+ wolfssl : ${{ fromJson(needs.create_matrix.outputs['versions']) }}
152+ name : Test wolfsftp large RW (10MB chunks, 3GB file)
153+ runs-on : ${{ matrix.os }}
154+ timeout-minutes : 20
155+ steps :
156+ - name : Checking cache for wolfssl
157+ uses : actions/cache@v4
158+ with :
159+ path : build-dir/
160+ key : wolfssh-sftp-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}-keygen
161+ fail-on-cache-miss : true
162+
163+ - uses : actions/checkout@v4
164+ with :
165+ path : wolfssh/
166+
167+ - name : autogen
168+ working-directory : ./wolfssh/
169+ run : ./autogen.sh
170+
171+ - name : configure
172+ working-directory : ./wolfssh/
173+ run : |
174+ ./configure --enable-all \
175+ LDFLAGS="-L${{ github.workspace }}/build-dir/lib" \
176+ CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=10485760 -DWOLFSSH_MAX_CHN_NAMESZ=4200"
177+
178+ - name : make
179+ working-directory : ./wolfssh/
180+ run : make
181+
182+ - name : Create 3GB test file
183+ working-directory : ./wolfssh/
184+ run : |
185+ dd if=/dev/urandom of=seed.dat bs=1M count=10
186+ for i in $(seq 1 308); do cat seed.dat >> large_test.dat; done
187+ rm seed.dat
188+ sha256sum large_test.dat > large_test.dat.sha256
189+ echo "Created 3GB test file, SHA-256: $(cat large_test.dat.sha256)"
190+
191+ - name : Start echoserver
192+ working-directory : ./wolfssh/
193+ run : |
194+ ./examples/echoserver/echoserver -N -1 -R /tmp/echoserver_ready -d "$(pwd)" &
195+ echo $! > /tmp/echoserver.pid
196+ for i in $(seq 1 30); do
197+ [ -s /tmp/echoserver_ready ] && break
198+ sleep 0.2
199+ done
200+ if [ ! -s /tmp/echoserver_ready ]; then
201+ echo "ERROR: echoserver failed to start"
202+ exit 1
203+ fi
204+ echo "Echoserver ready on port $(cat /tmp/echoserver_ready)"
205+
206+ - name : SFTP get 3GB file with 10MB chunk size
207+ working-directory : ./wolfssh/
208+ run : |
209+ port=$(cat /tmp/echoserver_ready)
210+ ./examples/sftpclient/wolfsftp -N -u jill -P upthehill -p "$port" \
211+ -G -l /tmp/large_test_copy.dat -r "$(pwd)/large_test.dat"
212+
213+ - name : Verify file integrity
214+ working-directory : ./wolfssh/
215+ run : |
216+ expected=$(awk '{print $1}' large_test.dat.sha256)
217+ actual=$(sha256sum /tmp/large_test_copy.dat | awk '{print $1}')
218+ echo "Expected SHA-256: $expected"
219+ echo "Actual SHA-256: $actual"
220+ if [ "$expected" != "$actual" ]; then
221+ echo "FAIL: SHA-256 mismatch"
222+ exit 1
223+ fi
224+ echo "PASS: 3GB SFTP transfer with WOLFSSH_MAX_SFTP_RW=10485760 succeeded"
225+
226+ - name : Stop echoserver
227+ if : always()
228+ run : kill "$(cat /tmp/echoserver.pid)" 2>/dev/null || true
0 commit comments