|
| 1 | +name: Socat Tests |
| 2 | + |
| 3 | +# START OF COMMON SECTION |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ 'master', 'main', 'release/**' ] |
| 7 | + pull_request: |
| 8 | + branches: [ '*' ] |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | +# END OF COMMON SECTION |
| 14 | + |
| 15 | +jobs: |
| 16 | + build_wolfprovider: |
| 17 | + name: Build wolfProvider |
| 18 | + runs-on: ubuntu-22.04 |
| 19 | + timeout-minutes: 20 |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + wolfssl_ref: [ 'master', 'v5.7.4-stable' ] |
| 23 | + steps: |
| 24 | + - name: Checkout wolfProvider |
| 25 | + uses: actions/checkout@v4 |
| 26 | + |
| 27 | + # Check if this version of wolfssl/wolfprovider has already been built, |
| 28 | + # mark to cache these items on post if we do end up building |
| 29 | + - name: Checking wolfSSL/wolfProvider in cache |
| 30 | + uses: actions/cache@v4 |
| 31 | + id: wolfprov-cache |
| 32 | + with: |
| 33 | + path: | |
| 34 | + wolfssl-source |
| 35 | + wolfssl-install |
| 36 | + wolfprov-install |
| 37 | + provider.conf |
| 38 | +
|
| 39 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }} |
| 40 | + lookup-only: true |
| 41 | + |
| 42 | + # If wolfssl/wolfprovider have not yet been built, pull ossl from cache |
| 43 | + - name: Checking OpenSSL in cache |
| 44 | + if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true' |
| 45 | + uses: actions/cache@v4 |
| 46 | + id: openssl-cache |
| 47 | + with: |
| 48 | + path: | |
| 49 | + openssl-source |
| 50 | + openssl-install |
| 51 | +
|
| 52 | + key: ossl-depends |
| 53 | + |
| 54 | + # If not yet built this version, build it now |
| 55 | + - name: Build wolfProvider |
| 56 | + if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true' |
| 57 | + run: | |
| 58 | + WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh |
| 59 | +
|
| 60 | + - name: Print errors |
| 61 | + if: ${{ failure() }} |
| 62 | + run: | |
| 63 | + if [ -f test-suite.log ] ; then |
| 64 | + cat test-suite.log |
| 65 | + fi |
| 66 | +
|
| 67 | + test_socat: |
| 68 | + runs-on: ubuntu-22.04 |
| 69 | + needs: build_wolfprovider |
| 70 | + # This should be a safe limit for the tests to run. |
| 71 | + timeout-minutes: 20 |
| 72 | + strategy: |
| 73 | + matrix: |
| 74 | + wolfssl_ref: [ 'master', 'v5.7.4-stable' ] |
| 75 | + steps: |
| 76 | + - name: Retrieving OpenSSL from cache |
| 77 | + uses: actions/cache/restore@v4 |
| 78 | + id: openssl-cache |
| 79 | + with: |
| 80 | + path: | |
| 81 | + openssl-source |
| 82 | + openssl-install |
| 83 | +
|
| 84 | + key: ossl-depends |
| 85 | + fail-on-cache-miss: true |
| 86 | + |
| 87 | + - name: Retrieving wolfSSL/wolfProvider from cache |
| 88 | + uses: actions/cache/restore@v4 |
| 89 | + id: wolfprov-cache |
| 90 | + with: |
| 91 | + path: | |
| 92 | + wolfssl-source |
| 93 | + wolfssl-install |
| 94 | + wolfprov-install |
| 95 | + provider.conf |
| 96 | +
|
| 97 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }} |
| 98 | + fail-on-cache-miss: true |
| 99 | + |
| 100 | + - name: Install socat dependencies |
| 101 | + run: | |
| 102 | + sudo apt-get update |
| 103 | + sudo apt-get install build-essential autoconf libtool pkg-config clang libc++-dev |
| 104 | +
|
| 105 | + - name: Download socat |
| 106 | + run: curl -O http://www.dest-unreach.org/socat/download/socat-1.8.0.0.tar.gz && tar xvf socat-1.8.0.0.tar.gz |
| 107 | + |
| 108 | + - name: Checkout OSP |
| 109 | + uses: actions/checkout@v4 |
| 110 | + with: |
| 111 | + repository: wolfssl/osp |
| 112 | + path: osp |
| 113 | + |
| 114 | + - name: Build socat |
| 115 | + working-directory: ./socat-1.8.0.0 |
| 116 | + run: | |
| 117 | + # Apply patch |
| 118 | + patch -p1 < ../osp/socat/1.8.0.0/socat-1.8.0.0.patch |
| 119 | +
|
| 120 | + # Configure with OpenSSL |
| 121 | + autoreconf -vfi |
| 122 | + ./configure --with-openssl=$GITHUB_WORKSPACE/openssl-install |
| 123 | +
|
| 124 | + # Build socat |
| 125 | + make |
| 126 | +
|
| 127 | + - name: Run socat tests |
| 128 | + working-directory: ./socat-1.8.0.0 |
| 129 | + run: | |
| 130 | + # Set up the environment for wolfProvider |
| 131 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64 |
| 132 | + export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf |
| 133 | + export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib |
| 134 | + export SHELL=/bin/bash |
| 135 | +
|
| 136 | + # Verify OpenSSL loads wolfProvider |
| 137 | + $GITHUB_WORKSPACE/openssl-install/bin/openssl list -providers |
| 138 | +
|
| 139 | + # Show socat version (includes OpenSSL version info) |
| 140 | + ./socat -V |
| 141 | +
|
| 142 | + # Run the tests with expected failures |
| 143 | + SOCAT=$GITHUB_WORKSPACE/socat-1.8.0.0/socat ./test.sh -t 0.5 --expect-fail 146,216,309,310,386,399,402,459,460,467,468,478,492,528,530 |
| 144 | +
|
0 commit comments