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.
pull/746/head
John Safranek 2024-07-24 15:16:15 -07:00 committed by JacobBarthelmeh
parent 3cabbdb703
commit 8d1efe9fdf
5 changed files with 69 additions and 31 deletions

View File

@ -10,15 +10,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
env:
WOLFSSL_REF: v5.7.0-stable
jobs: jobs:
build_wolfssl: build_wolfssl:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu-latest, macos-latest ] os: [ ubuntu-latest, macos-latest ]
wolfssl: [ v5.7.2-stable, master ]
name: Build wolfssl name: Build wolfssl
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 4 timeout-minutes: 4
@ -28,7 +26,7 @@ jobs:
id: cache-wolfssl id: cache-wolfssl
with: with:
path: build-dir/ path: build-dir/
key: wolfssh-os-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }} key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
lookup-only: true lookup-only: true
- name: Checkout, build, and install wolfssl - name: Checkout, build, and install wolfssl
@ -36,7 +34,7 @@ jobs:
uses: wolfSSL/actions-build-autotools-project@v1 uses: wolfSSL/actions-build-autotools-project@v1
with: with:
repository: wolfssl/wolfssl repository: wolfssl/wolfssl
ref: ${{ env.WOLFSSL_REF }} ref: ${{ matrix.wolfssl }}
path: wolfssl path: wolfssl
configure: --enable-all configure: --enable-all
check: false check: false
@ -47,6 +45,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu-latest, macos-latest ] os: [ ubuntu-latest, macos-latest ]
wolfssl: [ v5.7.2-stable, master ]
config: [ config: [
'', '',
'--enable-all', '--enable-all',
@ -63,7 +62,7 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: build-dir/ path: build-dir/
key: wolfssh-os-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }} key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
fail-on-cache-miss: true fail-on-cache-miss: true
- name: Checkout, build, and test wolfssh - name: Checkout, build, and test wolfssh

View File

@ -6,27 +6,66 @@ on:
pull_request: pull_request:
branches: [ '*' ] branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build_wolfssl:
strategy:
runs-on: ubuntu-latest fail-fast: false
matrix:
os: [ ubuntu-latest ]
wolfssl: [ v5.7.2-stable ]
name: Build wolfssl
runs-on: ${{ matrix.os }}
timeout-minutes: 4
steps: steps:
- uses: actions/checkout@v2 - name: Checking cache for wolfssl
with: uses: actions/cache@v4
repository: wolfSSL/wolfssl.git id: cache-wolfssl
ref: master with:
- name: build wolfSSL path: build-dir/
run: ./autogen.sh && ./configure --enable-all --prefix=/usr && make && sudo make install key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
- uses: actions/checkout@v2 lookup-only: true
- name: autogen
run: ./autogen.sh - name: Checkout, build, and install wolfssl
- name: configure if: steps.cache-wolfssl.outputs.cache-hit != 'true'
run: ./configure --enable-all CPPFLAGS="-DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000" uses: wolfSSL/actions-build-autotools-project@v1
- name: make with:
run: make repository: wolfssl/wolfssl
- name: make check ref: ${{ matrix.wolfssl }}
run: make check path: wolfssl
- name: run wolfSSHd tests configure: --enable-all
run: sudo ./run_all_sshd_tests.sh root check: false
working-directory: ./apps/wolfsshd/test install: true
build_wolfssh:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
wolfssl: [ v5.7.2-stable ]
name: Build and test wolfsshd
runs-on: ${{ matrix.os }}
timeout-minutes: 10
needs: build_wolfssl
steps:
- name: Checking cache for wolfssl
uses: actions/cache@v4
with:
path: build-dir/
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
fail-on-cache-miss: true
- name: Checkout and build wolfsshd
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: wolfssl/wolfssh
path: wolfssh
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"
check: true
- name: Run wolfSSHd tests
working-directory: wolfssh/apps/wolfsshd/test
run: sudo ./run_all_sshd_tests.sh root

View File

@ -4,7 +4,7 @@
if [ -z "$1" ] || [ -z "$2" ]; then if [ -z "$1" ] || [ -z "$2" ]; then
echo "expecting host and port as arguments" echo "expecting host and port as arguments"
echo "./sshd_exec_test.sh 127.0.0.1 22222" echo "$0 127.0.0.1 22222"
exit 1 exit 1
fi fi

View File

@ -7,7 +7,7 @@ cd ../../..
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
echo "expecting host, port and user as arguments" echo "expecting host, port and user as arguments"
echo "./sshd_x509_text.sh 127.0.0.1 22222 user" echo "$0 127.0.0.1 22222 user"
exit 1 exit 1
fi fi

View File

@ -6,7 +6,7 @@ else
USER_NAME=$1 USER_NAME=$1
cp fred-key.der $USER_NAME-key.der cp fred-key.der $USER_NAME-key.der
cp fred-key.pem $USER_NAME-key.pem cp fred-key.pem $USER_NAME-key.pem
sed -i "s/fred/$USER_NAME/g" renewcerts.cnf sed -i.bak "s/fred/$USER_NAME/g" renewcerts.cnf
fi fi
# renew CA # renew CA