Skip to content

Commit 8d1efe9

Browse files
ejohnstownJacobBarthelmeh
authored andcommitted
Testing Update
1. Update the sshd test to use the newer actions. 2. Parameterize the test for macos and ubuntu. 3. Parameterize the version of wolfssl used. 4. Parameterize the wolfSSH options used. 5. Update a couple test scripts to output their $0 variable instead of the wrong string.
1 parent 3cabbdb commit 8d1efe9

File tree

5 files changed

+67
-29
lines changed

5 files changed

+67
-29
lines changed

.github/workflows/os-check.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13-
env:
14-
WOLFSSL_REF: v5.7.0-stable
15-
1613
jobs:
1714
build_wolfssl:
1815
strategy:
1916
fail-fast: false
2017
matrix:
2118
os: [ ubuntu-latest, macos-latest ]
19+
wolfssl: [ v5.7.2-stable, master ]
2220
name: Build wolfssl
2321
runs-on: ${{ matrix.os }}
2422
timeout-minutes: 4
@@ -28,15 +26,15 @@ jobs:
2826
id: cache-wolfssl
2927
with:
3028
path: build-dir/
31-
key: wolfssh-os-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }}
29+
key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
3230
lookup-only: true
3331

3432
- name: Checkout, build, and install wolfssl
3533
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
3634
uses: wolfSSL/actions-build-autotools-project@v1
3735
with:
3836
repository: wolfssl/wolfssl
39-
ref: ${{ env.WOLFSSL_REF }}
37+
ref: ${{ matrix.wolfssl }}
4038
path: wolfssl
4139
configure: --enable-all
4240
check: false
@@ -47,6 +45,7 @@ jobs:
4745
fail-fast: false
4846
matrix:
4947
os: [ ubuntu-latest, macos-latest ]
48+
wolfssl: [ v5.7.2-stable, master ]
5049
config: [
5150
'',
5251
'--enable-all',
@@ -63,7 +62,7 @@ jobs:
6362
uses: actions/cache@v4
6463
with:
6564
path: build-dir/
66-
key: wolfssh-os-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }}
65+
key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
6766
fail-on-cache-miss: true
6867

6968
- name: Checkout, build, and test wolfssh

.github/workflows/sshd-test.yml

Lines changed: 59 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,66 @@ on:
66
pull_request:
77
branches: [ '*' ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
10-
build:
14+
build_wolfssl:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ ubuntu-latest ]
19+
wolfssl: [ v5.7.2-stable ]
20+
name: Build wolfssl
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 4
23+
steps:
24+
- name: Checking cache for wolfssl
25+
uses: actions/cache@v4
26+
id: cache-wolfssl
27+
with:
28+
path: build-dir/
29+
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
30+
lookup-only: true
1131

12-
runs-on: ubuntu-latest
32+
- name: Checkout, build, and install wolfssl
33+
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
34+
uses: wolfSSL/actions-build-autotools-project@v1
35+
with:
36+
repository: wolfssl/wolfssl
37+
ref: ${{ matrix.wolfssl }}
38+
path: wolfssl
39+
configure: --enable-all
40+
check: false
41+
install: true
1342

43+
build_wolfssh:
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
os: [ ubuntu-latest ]
48+
wolfssl: [ v5.7.2-stable ]
49+
name: Build and test wolfsshd
50+
runs-on: ${{ matrix.os }}
51+
timeout-minutes: 10
52+
needs: build_wolfssl
1453
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
repository: wolfSSL/wolfssl.git
18-
ref: master
19-
- name: build wolfSSL
20-
run: ./autogen.sh && ./configure --enable-all --prefix=/usr && make && sudo make install
21-
- uses: actions/checkout@v2
22-
- name: autogen
23-
run: ./autogen.sh
24-
- name: configure
25-
run: ./configure --enable-all CPPFLAGS="-DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000"
26-
- name: make
27-
run: make
28-
- name: make check
29-
run: make check
30-
- name: run wolfSSHd tests
31-
run: sudo ./run_all_sshd_tests.sh root
32-
working-directory: ./apps/wolfsshd/test
54+
- name: Checking cache for wolfssl
55+
uses: actions/cache@v4
56+
with:
57+
path: build-dir/
58+
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
59+
fail-on-cache-miss: true
60+
61+
- name: Checkout and build wolfsshd
62+
uses: wolfSSL/actions-build-autotools-project@v1
63+
with:
64+
repository: wolfssl/wolfssh
65+
path: wolfssh
66+
configure: --enable-debug --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000"
67+
check: true
68+
69+
- name: Run wolfSSHd tests
70+
working-directory: wolfssh/apps/wolfsshd/test
71+
run: sudo ./run_all_sshd_tests.sh root

apps/wolfsshd/test/sshd_forcedcmd_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
if [ -z "$1" ] || [ -z "$2" ]; then
66
echo "expecting host and port as arguments"
7-
echo "./sshd_exec_test.sh 127.0.0.1 22222"
7+
echo "$0 127.0.0.1 22222"
88
exit 1
99
fi
1010

apps/wolfsshd/test/sshd_x509_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cd ../../..
77

88
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
99
echo "expecting host, port and user as arguments"
10-
echo "./sshd_x509_text.sh 127.0.0.1 22222 user"
10+
echo "$0 127.0.0.1 22222 user"
1111
exit 1
1212
fi
1313

keys/renewcerts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ else
66
USER_NAME=$1
77
cp fred-key.der $USER_NAME-key.der
88
cp fred-key.pem $USER_NAME-key.pem
9-
sed -i "s/fred/$USER_NAME/g" renewcerts.cnf
9+
sed -i.bak "s/fred/$USER_NAME/g" renewcerts.cnf
1010
fi
1111

1212
# renew CA

0 commit comments

Comments
 (0)