Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/scripts/check-workflow-result.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -184,17 +184,17 @@ 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
echo "FAIL: net-snmp tests unexpectedly succeeded with force fail enabled"
exit 1
fi
else
echo "Error: tests/test.log not found"
echo "Error: tests/net-snmp-test.log not found"
exit 1
fi
# ----- NGINX -----
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 1 addition & 2 deletions .github/workflows/grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ipmitool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/net-snmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion .github/workflows/openldap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/socat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/stunnel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions .github/workflows/tcpdump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

107 changes: 107 additions & 0 deletions .github/workflows/tnftp.yml
Original file line number Diff line number Diff line change
@@ -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
Comment thread
padelsbach marked this conversation as resolved.
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
Comment thread
padelsbach marked this conversation as resolved.
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
Loading