diff --git a/.github/scripts/check-workflow-result.sh b/.github/scripts/check-workflow-result.sh index 351d7bd7..5c9a7cac 100755 --- a/.github/scripts/check-workflow-result.sh +++ b/.github/scripts/check-workflow-result.sh @@ -41,11 +41,11 @@ fi if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then # ----- CURL ----- if [ "$TEST_SUITE" = "curl" ]; then - if [ -f "tests/test.log" ]; then + if [ -f "curl-test.log" ]; then # Extract and clean the failed test list from the log - ACTUAL_FAILS=$(grep -a '^TESTFAIL: These test cases failed:' tests/test.log | sed 's/.*failed: //') + ACTUAL_FAILS=$(grep -a '^TESTFAIL: These test cases failed:' curl-test.log | sed 's/.*failed: //') else - echo "Error: tests/test.log not found" + echo "Error: curl-test.log not found" exit 1 fi @@ -184,9 +184,9 @@ if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then fi # ----- NET-SNMP ----- elif [ "$TEST_SUITE" = "net-snmp" ]; then - if [ -f "tests/test.log" ]; then + if [ -f "net-snmp-test.log" ]; then # Check if we have exactly 29 failed tests and a FAIL result - if grep -q "We failed these 29 tests:" tests/test.log && grep -q "Result: FAIL" tests/test.log; then + if grep -q "We failed these 29 tests:" net-snmp-test.log && grep -q "Result: FAIL" net-snmp-test.log; then echo "PASS: net-snmp tests failed as expected with force fail enabled" exit 0 else @@ -194,7 +194,7 @@ if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then exit 1 fi else - echo "Error: tests/test.log not found" + echo "Error: tests/net-snmp-test.log not found" exit 1 fi # ----- NGINX ----- @@ -214,9 +214,9 @@ if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then fi # ----- STUNNEL ----- elif [ "$TEST_SUITE" = "stunnel" ]; then - if [ -f "$GITHUB_WORKSPACE/tests/stunnel-test.log" ]; then + if [ -f "stunnel-test.log" ]; then # Check for expected error patterns - if grep -q "failed: 41" "$GITHUB_WORKSPACE/tests/stunnel-test.log"; then + if grep -q "failed: 41" "stunnel-test.log"; then echo "PASS: stunnel tests failed as expected with force fail enabled" exit 0 else diff --git a/.github/workflows/curl.yml b/.github/workflows/curl.yml index c570ef7d..bcfe07d7 100644 --- a/.github/workflows/curl.yml +++ b/.github/workflows/curl.yml @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 1 - + - name: Retrieving wolfSSL/wolfProvider from cache uses: actions/cache/restore@v4 id: wolfprov-cache @@ -89,7 +89,6 @@ jobs: export CURL_REF=${{ matrix.curl_ref }} # Run tests and save output to test.log - mkdir -p tests - make -j$(nproc) test-ci 2>&1 | tee tests/test.log + make -j$(nproc) test-ci 2>&1 | tee curl-test.log TEST_RESULT=$? $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} curl diff --git a/.github/workflows/grpc.yml b/.github/workflows/grpc.yml index 729da246..3166de6c 100644 --- a/.github/workflows/grpc.yml +++ b/.github/workflows/grpc.yml @@ -46,7 +46,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 1 - + - name: Retrieving wolfSSL/wolfProvider from cache uses: actions/cache/restore@v4 id: wolfprov-cache @@ -89,7 +89,6 @@ jobs: run: | # Set up the environment for wolfProvider source $GITHUB_WORKSPACE/scripts/env-setup - export ${{ matrix.force_fail }} # Initialize submodules git submodule update --init diff --git a/.github/workflows/ipmitool.yml b/.github/workflows/ipmitool.yml index 7f0acc65..d2d7b552 100644 --- a/.github/workflows/ipmitool.yml +++ b/.github/workflows/ipmitool.yml @@ -74,7 +74,6 @@ jobs: run: | # Set up the environment for wolfProvider source $GITHUB_WORKSPACE/scripts/env-setup - export ${{ matrix.force_fail }} # Verify ipmitool was built and linked correctly with OpenSSL ldd src/ipmitool | grep -E '(libssl|libcrypto)' diff --git a/.github/workflows/net-snmp.yml b/.github/workflows/net-snmp.yml index 0ae7f3cc..ca8a6616 100644 --- a/.github/workflows/net-snmp.yml +++ b/.github/workflows/net-snmp.yml @@ -83,7 +83,6 @@ jobs: export ${{ matrix.force_fail }} autoconf --version | grep -P '2\.\d\d' -o > dist/autoconf-version - mkdir -p tests - make -j test TESTOPTS="-e agentxperl" | tee tests/test.log + make -j test TESTOPTS="-e agentxperl" | tee net-snmp-test.log TEST_RESULT=$? $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} net-snmp diff --git a/.github/workflows/openldap.yml b/.github/workflows/openldap.yml index 81ea6357..c56b0879 100644 --- a/.github/workflows/openldap.yml +++ b/.github/workflows/openldap.yml @@ -72,7 +72,6 @@ jobs: run: | # Set up the environment for wolfProvider source $GITHUB_WORKSPACE/scripts/env-setup - export ${{ matrix.force_fail }} # Generate configure script rm -f aclocal.m4 diff --git a/.github/workflows/simple.yml b/.github/workflows/simple.yml index 41e6665d..78dad7c0 100644 --- a/.github/workflows/simple.yml +++ b/.github/workflows/simple.yml @@ -22,7 +22,6 @@ jobs: openssl_ref: [ 'master', 'openssl-3.5.0' ] wolfssl_ref: [ 'master', 'v5.8.0-stable' ] force_fail: ['WOLFPROV_FORCE_FAIL=1', ''] - steps: - name: Checkout wolfProvider uses: actions/checkout@v4 diff --git a/.github/workflows/socat.yml b/.github/workflows/socat.yml index edf1e98b..ee6d0fa8 100644 --- a/.github/workflows/socat.yml +++ b/.github/workflows/socat.yml @@ -75,7 +75,6 @@ jobs: run: | # Set up the environment for wolfProvider source $GITHUB_WORKSPACE/scripts/env-setup - export ${{ matrix.force_fail }} # Verify OpenSSL loads wolfProvider $GITHUB_WORKSPACE/openssl-install/bin/openssl list -providers diff --git a/.github/workflows/stunnel.yml b/.github/workflows/stunnel.yml index cd946044..336cf480 100644 --- a/.github/workflows/stunnel.yml +++ b/.github/workflows/stunnel.yml @@ -95,7 +95,6 @@ jobs: ./src/stunnel -version # Run tests and capture output - mkdir -p $GITHUB_WORKSPACE/tests - make check 2>&1 | tee $GITHUB_WORKSPACE/tests/stunnel-test.log + make check 2>&1 | tee stunnel-test.log TEST_RESULT=$? $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} stunnel diff --git a/.github/workflows/tcpdump.yml b/.github/workflows/tcpdump.yml index 06347929..7821c633 100644 --- a/.github/workflows/tcpdump.yml +++ b/.github/workflows/tcpdump.yml @@ -26,14 +26,13 @@ jobs: timeout-minutes: 15 strategy: matrix: + tcpdump_ref: [ 'master', 'tcpdump-4.99.3' ] wolfssl_ref: [ 'master', 'v5.8.0-stable' ] openssl_ref: [ 'openssl-3.5.0' ] - tcpdump_ref: [ 'master', 'tcpdump-4.99.3' ] force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ] exclude: - tcpdump_ref: 'master' force_fail: 'WOLFPROV_FORCE_FAIL=1' - steps: - name: Checkout wolfProvider uses: actions/checkout@v4 @@ -99,14 +98,14 @@ jobs: # Set up the environment for wolfProvider source $GITHUB_WORKSPACE/scripts/env-setup export ${{ matrix.force_fail }} - + # Run tests make check 2>&1 | tee tcpdump-test.log TEST_RESULT=$? - + if [ $TEST_RESULT -ne 0 ]; then grep -A2 -B2 "exit code\|failed\|FAILED" tcpdump-test.log || true fi - + $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} tcpdump diff --git a/.github/workflows/tnftp.yml b/.github/workflows/tnftp.yml new file mode 100644 index 00000000..a5b4140b --- /dev/null +++ b/.github/workflows/tnftp.yml @@ -0,0 +1,107 @@ +name: tnftp Tests + +# START OF COMMON SECTION +on: + push: + branches: [ 'master', 'main', 'release/**' ] + pull_request: + branches: [ '*' ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +# END OF COMMON SECTION + +jobs: + build_wolfprovider: + uses: ./.github/workflows/build-wolfprovider.yml + with: + wolfssl_ref: ${{ matrix.wolfssl_ref }} + openssl_ref: ${{ matrix.openssl_ref }} + strategy: + matrix: + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] + openssl_ref: [ 'openssl-3.5.0' ] + + test_tnftp: + runs-on: ubuntu-22.04 + needs: build_wolfprovider + # This should be a safe limit for the tests to run. + timeout-minutes: 20 + strategy: + matrix: + tnftp_ref: [ 'tnftp-20210827' ] + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] + openssl_ref: [ 'openssl-3.5.0' ] + force_fail: ['WOLFPROV_FORCE_FAIL=1', ''] + steps: + - name: Checkout wolfProvider + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Retrieving wolfSSL/wolfProvider from cache + uses: actions/cache/restore@v4 + id: wolfprov-cache + with: + path: | + scripts + wolfssl-source + wolfssl-install + wolfprov-install + openssl-install + provider.conf + + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }} + fail-on-cache-miss: true + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential autoconf libtool pkg-config vsftpd + + - name: Download and extract tnftp + run: | + wget http://ftp.netbsd.org/pub/NetBSD/misc/tnftp/${{ matrix.tnftp_ref }}.tar.gz + tar xvf ${{ matrix.tnftp_ref }}.tar.gz + cd ${{ matrix.tnftp_ref }} + + - name: Build and test tnftp + working-directory: ${{ matrix.tnftp_ref }} + run: | + # Set up the environment for wolfProvider + source $GITHUB_WORKSPACE/scripts/env-setup + export ${{ matrix.force_fail }} + + # Configure with OpenSSL + ./configure --with-openssl=$GITHUB_WORKSPACE/openssl-install + + # Build tnftp + make -j + + # Run all tests and capture output + { + echo "Testing tnftp basic functionality..." + + # Test help command + if ./src/tnftp -? 2>&1 | grep -q "usage:"; then + echo "tnftp help command works" + else + echo "tnftp help command failed" + exit 1 + fi + + # Test that tnftp can start (even if it fails to connect) + echo "Testing tnftp connection attempt..." + timeout 10 ./src/tnftp -n 192.0.2.1 2>&1 | head -10 + echo "tnftp can attempt connections" + + # Test SSL/TLS functionality + echo "Testing SSL/TLS connection..." + timeout 15 ./src/tnftp -n https://httpbin.org/get 2>&1 + echo "SSL/TLS test completed" + } 2>&1 | tee tnftp-test.log + + # Capture result and check for expected failure + TEST_RESULT=$(grep -q "SSL context creation failed" tnftp-test.log && echo "1" || echo "0") + $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} tnftp