|
| 1 | +name: Git SSH Default Replace Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'master', 'main', 'release/**', ] |
| 6 | + pull_request: |
| 7 | + branches: [ '*' ] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + build_wolfprovider: |
| 15 | + uses: ./.github/workflows/build-wolfprovider.yml |
| 16 | + with: |
| 17 | + wolfssl_ref: ${{ matrix.wolfssl_ref }} |
| 18 | + openssl_ref: ${{ matrix.openssl_ref }} |
| 19 | + replace_default: ${{ matrix.replace_default }} |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + wolfssl_ref: [ 'v5.8.2-stable' ] |
| 23 | + openssl_ref: [ 'openssl-3.5.2' ] |
| 24 | + replace_default: [ true ] |
| 25 | + fips: [ false ] |
| 26 | + |
| 27 | + git-ssh-default-replace-test: |
| 28 | + runs-on: ubuntu-22.04 |
| 29 | + container: |
| 30 | + image: debian:bookworm |
| 31 | + env: |
| 32 | + DEBIAN_FRONTEND: noninteractive |
| 33 | + needs: build_wolfprovider |
| 34 | + # This should be a safe limit for the tests to run. |
| 35 | + timeout-minutes: 20 |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + wolfssl_ref: [ 'v5.8.2-stable' ] |
| 39 | + openssl_ref: [ 'openssl-3.5.2' ] |
| 40 | + replace_default: [ true ] |
| 41 | + fips: [ false ] |
| 42 | + key_type: [ 'rsa', 'ecdsa', 'ed25519', 'chacha20-poly1305' ] |
| 43 | + force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ] |
| 44 | + iterations: [ 10 ] # Total of 50 runs |
| 45 | + env: |
| 46 | + WOLFSSL_PACKAGES_PATH: /tmp/wolfssl-packages |
| 47 | + OPENSSL_PACKAGES_PATH: /tmp/openssl-packages |
| 48 | + WOLFPROV_PACKAGES_PATH: /tmp/wolfprov-packages |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout wolfProvider |
| 52 | + uses: actions/checkout@v4 |
| 53 | + with: |
| 54 | + fetch-depth: 1 |
| 55 | + |
| 56 | + - name: Checking OpenSSL/wolfProvider packages in cache |
| 57 | + uses: actions/cache/restore@v4 |
| 58 | + id: wolfprov-cache |
| 59 | + with: |
| 60 | + path: | |
| 61 | + ${{ env.WOLFSSL_PACKAGES_PATH }} |
| 62 | + ${{ env.OPENSSL_PACKAGES_PATH }} |
| 63 | + ${{ env.WOLFPROV_PACKAGES_PATH }} |
| 64 | + key: openssl-wolfprov-debian-packages-${{ github.sha }}${{ matrix.replace_default && '-replace-default' || '' }} |
| 65 | + fail-on-cache-miss: true |
| 66 | + |
| 67 | + - name: Install wolfSSL/OpenSSL/wolfprov packages |
| 68 | + run: | |
| 69 | + printf "Installing OpenSSL/wolfProvider packages:\n" |
| 70 | + ls -la ${{ env.WOLFSSL_PACKAGES_PATH }} |
| 71 | + ls -la ${{ env.OPENSSL_PACKAGES_PATH }} |
| 72 | + ls -la ${{ env.WOLFPROV_PACKAGES_PATH }} |
| 73 | +
|
| 74 | + apt install --reinstall -y \ |
| 75 | + ${{ env.WOLFSSL_PACKAGES_PATH }}/libwolfssl_*.deb |
| 76 | +
|
| 77 | + apt install --reinstall -y \ |
| 78 | + ${{ env.OPENSSL_PACKAGES_PATH }}/openssl_*.deb \ |
| 79 | + ${{ env.OPENSSL_PACKAGES_PATH }}/libssl3_*.deb \ |
| 80 | + ${{ env.OPENSSL_PACKAGES_PATH }}/libssl-dev_*.deb |
| 81 | +
|
| 82 | + apt install --reinstall -y \ |
| 83 | + ${{ env.WOLFPROV_PACKAGES_PATH }}/libwolfprov_*.deb |
| 84 | +
|
| 85 | + - name: Verify wolfProvider is properly installed |
| 86 | + run: | |
| 87 | + $GITHUB_WORKSPACE/scripts/verify-install.sh ${{ matrix.replace_default && '--replace-default' || '' }} ${{ matrix.fips && '--fips' || '' }} |
| 88 | +
|
| 89 | + - name: Set up environment |
| 90 | + run: | |
| 91 | + export DEBIAN_FRONTEND=noninteractive |
| 92 | + apt-get update |
| 93 | + apt-get install -y openssh-client openssh-server expect xxd git \ |
| 94 | + net-tools git-all |
| 95 | +
|
| 96 | + - name: Run git + replace default + ssh test |
| 97 | + shell: bash |
| 98 | + run: | |
| 99 | + echo "=== Running Git + replace default + ssh Test ===" |
| 100 | + echo "Using the local test script for consistent testing" |
| 101 | + # Run the test with the matrix parameters |
| 102 | + echo "Testing with key type: ${{ matrix.key_type }}" |
| 103 | + echo "Running ${{ matrix.iterations }} iterations" |
| 104 | +
|
| 105 | + # Run the scripts test |
| 106 | + ${{ matrix.force_fail }} ./scripts/test-git-ssh-dr.sh \ |
| 107 | + --key-types "${{ matrix.key_type }}" \ |
| 108 | + --iterations "${{ matrix.iterations }}" \ |
| 109 | + --verbose |
| 110 | +
|
| 111 | + echo "=== Test completed for ${{ matrix.key_type }} ===" |
0 commit comments