Skip to content

Commit

Permalink
Testing Update
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ejohnstown authored and JacobBarthelmeh committed Oct 4, 2024
1 parent 3cabbdb commit 8d1efe9
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 29 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/os-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
WOLFSSL_REF: v5.7.0-stable

jobs:
build_wolfssl:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
wolfssl: [ v5.7.2-stable, master ]
name: Build wolfssl
runs-on: ${{ matrix.os }}
timeout-minutes: 4
Expand All @@ -28,15 +26,15 @@ jobs:
id: cache-wolfssl
with:
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

- name: Checkout, build, and install wolfssl
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: wolfssl/wolfssl
ref: ${{ env.WOLFSSL_REF }}
ref: ${{ matrix.wolfssl }}
path: wolfssl
configure: --enable-all
check: false
Expand All @@ -47,6 +45,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
wolfssl: [ v5.7.2-stable, master ]
config: [
'',
'--enable-all',
Expand All @@ -63,7 +62,7 @@ jobs:
uses: actions/cache@v4
with:
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

- name: Checkout, build, and test wolfssh
Expand Down
79 changes: 59 additions & 20 deletions .github/workflows/sshd-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,66 @@ on:
pull_request:
branches: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
build_wolfssl:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
wolfssl: [ v5.7.2-stable ]
name: Build wolfssl
runs-on: ${{ matrix.os }}
timeout-minutes: 4
steps:
- name: Checking cache for wolfssl
uses: actions/cache@v4
id: cache-wolfssl
with:
path: build-dir/
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
lookup-only: true

runs-on: ubuntu-latest
- name: Checkout, build, and install wolfssl
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: wolfssl/wolfssl
ref: ${{ matrix.wolfssl }}
path: wolfssl
configure: --enable-all
check: false
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:
- uses: actions/checkout@v2
with:
repository: wolfSSL/wolfssl.git
ref: master
- name: build wolfSSL
run: ./autogen.sh && ./configure --enable-all --prefix=/usr && make && sudo make install
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --enable-all CPPFLAGS="-DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000"
- name: make
run: make
- name: make check
run: make check
- name: run wolfSSHd tests
run: sudo ./run_all_sshd_tests.sh root
working-directory: ./apps/wolfsshd/test
- 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
2 changes: 1 addition & 1 deletion apps/wolfsshd/test/sshd_forcedcmd_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

if [ -z "$1" ] || [ -z "$2" ]; then
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
fi

Expand Down
2 changes: 1 addition & 1 deletion apps/wolfsshd/test/sshd_x509_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd ../../..

if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
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
fi

Expand Down
2 changes: 1 addition & 1 deletion keys/renewcerts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ else
USER_NAME=$1
cp fred-key.der $USER_NAME-key.der
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

# renew CA
Expand Down

0 comments on commit 8d1efe9

Please sign in to comment.