Skip to content

Commit 8a95fa4

Browse files
committed
Rebase PR#123 so we have PR#131 changes to fix socat test
1 parent ddcae30 commit 8a95fa4

File tree

12 files changed

+317
-59
lines changed

12 files changed

+317
-59
lines changed

.github/scripts/check-workflow-result.sh

Lines changed: 141 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
#!/bin/bash
2+
# check-workflow-result.sh
3+
#
4+
# Copyright (C) 2006-2024 wolfSSL Inc.
5+
#
6+
# This file is part of wolfProvider.
7+
#
8+
# wolfProvider is free software; you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation; either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# wolfProvider is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License
19+
# along with this program; if not, write to the Free Software
20+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
221

322
set -e
423

@@ -11,14 +30,17 @@ TEST_RESULT="$1"
1130
WOLFPROV_FORCE_FAIL="${2:-}"
1231
TEST_SUITE="${3:-}"
1332

33+
# Ensure TEST_RESULT is treated as a number
34+
TEST_RESULT=$((TEST_RESULT + 0))
35+
1436
# If force fail is empty treat second arg as test suite
1537
if [ -z "$WOLFPROV_FORCE_FAIL" ]; then
1638
TEST_SUITE="${2:-}"
1739
fi
1840

1941
if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then
42+
# ----- CURL -----
2043
if [ "$TEST_SUITE" = "curl" ]; then
21-
# --- curl-specific logic ---
2244
if [ -f "tests/test.log" ]; then
2345
# Extract and clean the failed test list from the log
2446
ACTUAL_FAILS=$(grep -a '^TESTFAIL: These test cases failed:' tests/test.log | sed 's/.*failed: //')
@@ -74,13 +96,128 @@ if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then
7496
echo "FAIL: Actual failed tests do not match expected."
7597
exit 1
7698
fi
99+
# ----- OPENVPN -----
100+
elif [ "$TEST_SUITE" = "openvpn" ]; then
101+
if [ -f "openvpn-test.log" ]; then
102+
# Extract failed tests from the log
103+
ACTUAL_FAILS=$(grep -a '^FAIL: ' openvpn-test.log | sed 's/^FAIL: //' | sort)
104+
105+
# Define expected failures
106+
EXPECTED_FAILS="auth_token_testdriver crypto_testdriver pkt_testdriver tls_crypt_testdriver"
107+
108+
# Create temporary files for sorted lists
109+
TEMP_DIR=$(mktemp -d)
110+
ACTUAL_SORTED="${TEMP_DIR}/actual_sorted.txt"
111+
EXPECTED_SORTED="${TEMP_DIR}/expected_sorted.txt"
112+
113+
# Clean and sort both lists
114+
echo "$ACTUAL_FAILS" | tr ' ' '\n' | grep -v '^$' | sort > "$ACTUAL_SORTED"
115+
echo "$EXPECTED_FAILS" | tr ' ' '\n' | grep -v '^$' | sort > "$EXPECTED_SORTED"
116+
117+
echo "DEBUG: Actual failed tests: $(tr '\n' ' ' < "$ACTUAL_SORTED")"
118+
echo "DEBUG: Expected failed tests: $(tr '\n' ' ' < "$EXPECTED_SORTED")"
119+
120+
# Find missing in actual (in expected but not in actual)
121+
MISSING=$(comm -23 "$EXPECTED_SORTED" "$ACTUAL_SORTED" | tr '\n' ' ')
122+
# Find extra in actual (in actual but not in expected)
123+
EXTRA=$(comm -13 "$EXPECTED_SORTED" "$ACTUAL_SORTED" | tr '\n' ' ')
124+
125+
# Clean up temporary files
126+
rm -rf "$TEMP_DIR"
127+
128+
echo "Test(s) that should have failed: $MISSING"
129+
echo "Test(s) that shouldn't have failed: $EXTRA"
130+
131+
if [ -z "$MISSING" ] && [ -z "$EXTRA" ]; then
132+
echo "PASS: Actual failed tests match expected."
133+
exit 0
134+
else
135+
echo "FAIL: Actual failed tests do not match expected."
136+
exit 1
137+
fi
138+
else
139+
echo "Error: openvpn-test.log not found"
140+
exit 1
141+
fi
142+
# ----- SSSD -----
143+
elif [ "$TEST_SUITE" = "sssd" ]; then
144+
if [ -f "sssd-test.log" ]; then
145+
# Extract failed tests from the log
146+
ACTUAL_FAILS=$(grep -a '^FAIL: ' sssd-test.log | sed 's/^FAIL: //' | sort)
147+
148+
# Define expected failures
149+
EXPECTED_FAILS="src/tests/pysss-test.py3.sh pam-srv-tests ssh-srv-tests test_cert_utils sss_certmap_test sysdb-tests crypto-tests"
150+
151+
# Create temporary files for sorted lists
152+
TEMP_DIR=$(mktemp -d)
153+
ACTUAL_SORTED="${TEMP_DIR}/actual_sorted.txt"
154+
EXPECTED_SORTED="${TEMP_DIR}/expected_sorted.txt"
155+
156+
# Clean and sort both lists
157+
echo "$ACTUAL_FAILS" | tr ' ' '\n' | grep -v '^$' | sort > "$ACTUAL_SORTED"
158+
echo "$EXPECTED_FAILS" | tr ' ' '\n' | grep -v '^$' | sort > "$EXPECTED_SORTED"
159+
160+
echo "DEBUG: Actual failed tests: $(tr '\n' ' ' < "$ACTUAL_SORTED")"
161+
echo "DEBUG: Expected failed tests: $(tr '\n' ' ' < "$EXPECTED_SORTED")"
162+
163+
# Find missing in actual (in expected but not in actual)
164+
MISSING=$(comm -23 "$EXPECTED_SORTED" "$ACTUAL_SORTED" | tr '\n' ' ')
165+
# Find extra in actual (in actual but not in expected)
166+
EXTRA=$(comm -13 "$EXPECTED_SORTED" "$ACTUAL_SORTED" | tr '\n' ' ')
167+
168+
# Clean up temporary files
169+
rm -rf "$TEMP_DIR"
170+
171+
echo "Test(s) that should have failed: $MISSING"
172+
echo "Test(s) that shouldn't have failed: $EXTRA"
173+
174+
if [ -z "$MISSING" ] && [ -z "$EXTRA" ]; then
175+
echo "PASS: Actual failed tests match expected."
176+
exit 0
177+
else
178+
echo "FAIL: Actual failed tests do not match expected."
179+
exit 1
180+
fi
181+
else
182+
echo "Error: sssd-test.log not found"
183+
exit 1
184+
fi
185+
# ----- NGINX -----
186+
elif [ "$TEST_SUITE" = "nginx" ]; then
187+
if [ -f "nginx-test.log" ]; then
188+
# Check if the test result shows FAIL
189+
if grep -q "Result: FAIL" nginx-test.log; then
190+
echo "PASS: nginx tests failed as expected with force fail enabled"
191+
exit 0
192+
else
193+
echo "FAIL: nginx tests unexpectedly succeeded with force fail enabled"
194+
exit 1
195+
fi
196+
else
197+
echo "Error: nginx-test.log not found"
198+
exit 1
199+
fi
200+
# ----- STUNNEL -----
201+
elif [ "$TEST_SUITE" = "stunnel" ]; then
202+
if [ -f "$GITHUB_WORKSPACE/tests/stunnel-test.log" ]; then
203+
# Check for expected error patterns
204+
if grep -q "failed: 41" "$GITHUB_WORKSPACE/tests/stunnel-test.log"; then
205+
echo "PASS: stunnel tests failed as expected with force fail enabled"
206+
exit 0
207+
else
208+
echo "FAIL: stunnel tests unexpectedly succeeded with force fail enabled"
209+
exit 1
210+
fi
211+
else
212+
echo "Error: stunnel-test.log not found"
213+
exit 1
214+
fi
77215
else
78-
# --- generic force-fail logic for other suites ---
79216
if [ $TEST_RESULT -eq 0 ]; then
80-
echo "Test unexpectedly succeeded with force fail enabled"
217+
echo "$TEST_SUITE tests unexpectedly succeeded with force fail enabled"
81218
exit 1 # failure was not seen when expected
82219
else
83-
echo "Test failed as expected with force fail enabled"
220+
echo "$TEST_SUITE tests failed as expected with force fail enabled"
84221
exit 0 # expected failure occurred
85222
fi
86223
fi

.github/workflows/curl.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
23+
openssl_ref: [ 'openssl-3.2.0' ]
2324
steps:
2425
- name: Checkout wolfProvider
2526
uses: actions/checkout@v4
@@ -49,7 +50,7 @@ jobs:
4950
openssl-source
5051
openssl-install
5152
52-
key: ossl-depends
53+
key: ossl-depends-${{ matrix.openssl_ref }}
5354

5455
# If not yet built this version, build it now
5556
- name: Build wolfProvider
@@ -73,7 +74,11 @@ jobs:
7374
matrix:
7475
curl_ref: [ 'master', 'curl-8_4_0' ]
7576
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
77+
openssl_ref: [ 'openssl-3.2.0' ]
7678
force_fail: ['WOLFPROV_FORCE_FAIL=1', '']
79+
exclude:
80+
- curl_ref: 'master'
81+
force_fail: 'WOLFPROV_FORCE_FAIL=1'
7782
steps:
7883
- name: Checkout wolfProvider
7984
uses: actions/checkout@v4
@@ -86,7 +91,7 @@ jobs:
8691
openssl-source
8792
openssl-install
8893
89-
key: ossl-depends
94+
key: ossl-depends-${{ matrix.openssl_ref }}
9095
fail-on-cache-miss: true
9196

9297
- name: Retrieving wolfSSL/wolfProvider from cache

.github/workflows/grpc.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
23+
openssl_ref: [ 'openssl-3.2.0' ]
2324
steps:
2425
- name: Checkout wolfProvider
2526
uses: actions/checkout@v4
@@ -49,7 +50,7 @@ jobs:
4950
openssl-source
5051
openssl-install
5152
52-
key: ossl-depends
53+
key: ossl-depends-${{ matrix.openssl_ref }}
5354
fail-on-cache-miss: false
5455

5556
# If not yet built this version, build it now
@@ -74,15 +75,22 @@ jobs:
7475
fail-fast: false
7576
matrix:
7677
include:
77-
- ref: v1.60.0
78+
- grpc_ref: [ 'master', 'v1.60.0' ]
7879
tests: >-
7980
bad_ssl_alpn_test bad_ssl_cert_test client_ssl_test
8081
crl_ssl_transport_security_test server_ssl_test
8182
ssl_transport_security_test ssl_transport_security_utils_test
8283
test_core_security_ssl_credentials_test test_cpp_end2end_ssl_credentials_test
8384
h2_ssl_cert_test h2_ssl_session_reuse_test
8485
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
86+
openssl_ref: [ 'openssl-3.2.0' ]
87+
exclude:
88+
- grpc_ref: 'master'
89+
force_fail: 'WOLFPROV_FORCE_FAIL=1'
8590
steps:
91+
- name: Checkout wolfProvider
92+
uses: actions/checkout@v4
93+
8694
- name: Confirm IPv4 and IPv6 support
8795
run: |
8896
ip addr list lo | grep 'inet '
@@ -96,7 +104,7 @@ jobs:
96104
openssl-source
97105
openssl-install
98106
99-
key: ossl-depends
107+
key: ossl-depends-${{ matrix.openssl_ref }}
100108
fail-on-cache-miss: false
101109

102110
- name: Retrieving wolfSSL/wolfProvider from cache
@@ -127,7 +135,7 @@ jobs:
127135
with:
128136
repository: grpc/grpc
129137
path: grpc
130-
ref: ${{ matrix.ref }}
138+
ref: ${{ matrix.grpc_ref }}
131139

132140
- name: Build grpc with wolfProvider
133141
working-directory: ./grpc

.github/workflows/ipmitool.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
23+
openssl_ref: [ 'openssl-3.2.0' ]
2324
steps:
2425
- name: Checkout wolfProvider
2526
uses: actions/checkout@v4
@@ -49,7 +50,7 @@ jobs:
4950
openssl-source
5051
openssl-install
5152
52-
key: ossl-depends
53+
key: ossl-depends-${{ matrix.openssl_ref }}
5354
fail-on-cache-miss: false
5455

5556
# If not yet built this version, build it now
@@ -73,8 +74,12 @@ jobs:
7374
strategy:
7475
fail-fast: false
7576
matrix:
76-
git_ref: [ c3939dac2c060651361fc71516806f9ab8c38901 ]
77+
ipmitool_ref: [ 'master', 'c3939dac2c060651361fc71516806f9ab8c38901' ]
7778
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
79+
openssl_ref: [ 'openssl-3.2.0' ]
80+
exclude:
81+
- ipmitool_ref: 'master'
82+
force_fail: 'WOLFPROV_FORCE_FAIL=1'
7883
steps:
7984
- name: Retrieving OpenSSL from cache
8085
uses: actions/cache/restore@v4
@@ -84,7 +89,7 @@ jobs:
8489
openssl-source
8590
openssl-install
8691
87-
key: ossl-depends
92+
key: ossl-depends-${{ matrix.openssl_ref }}
8893
fail-on-cache-miss: false
8994

9095
- name: Retrieving wolfSSL/wolfProvider from cache
@@ -110,9 +115,8 @@ jobs:
110115
uses: wolfSSL/actions-build-autotools-project@v1
111116
with:
112117
repository: ipmitool/ipmitool
113-
ref: ${{ matrix.git_ref }}
118+
ref: ${{ matrix.ipmitool_ref }}
114119
path: ipmitool
115-
configure: --with-openssl=$GITHUB_WORKSPACE/openssl-install
116120
check: false
117121

118122
- name: Confirm built with OpenSSL and test with wolfProvider

.github/workflows/multi-compiler.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,3 @@ jobs:
111111
if [ -f config.log ]; then
112112
cat config.log
113113
fi
114-

.github/workflows/nginx.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
23+
openssl_ref: [ 'openssl-3.2.0' ]
2324
steps:
2425
- name: Checkout wolfProvider
2526
uses: actions/checkout@v4
@@ -49,7 +50,7 @@ jobs:
4950
openssl-source
5051
openssl-install
5152
52-
key: ossl-depends
53+
key: ossl-depends-${{ matrix.openssl_ref }}
5354

5455
# If not yet built this version, build it now
5556
- name: Build wolfProvider
@@ -73,7 +74,15 @@ jobs:
7374
matrix:
7475
nginx_ref: [ 'master', 'release-1.27.4' ]
7576
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
77+
openssl_ref: [ 'openssl-3.2.0' ]
78+
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '']
79+
exclude:
80+
- nginx_ref: 'master'
81+
force_fail: 'WOLFPROV_FORCE_FAIL=1'
7682
steps:
83+
- name: Checkout wolfProvider
84+
uses: actions/checkout@v4
85+
7786
- name: Retrieving OpenSSL from cache
7887
uses: actions/cache/restore@v4
7988
id: openssl-cache
@@ -82,7 +91,7 @@ jobs:
8291
openssl-source
8392
openssl-install
8493
85-
key: ossl-depends
94+
key: ossl-depends-${{ matrix.openssl_ref }}
8695
fail-on-cache-miss: true
8796

8897
- name: Retrieving wolfSSL/wolfProvider from cache
@@ -125,7 +134,13 @@ jobs:
125134
- name: Run nginx-tests with wolfProvider
126135
working-directory: nginx-tests
127136
run: |
137+
# Set environment variables
128138
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
129139
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
130140
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
131-
TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y TEST_NGINX_BINARY=../nginx/objs/nginx prove -v .
141+
export ${{ matrix.force_fail }}
142+
143+
# Run tests and save result
144+
TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y TEST_NGINX_BINARY=../nginx/objs/nginx prove -v . 2>&1 | tee nginx-test.log || true
145+
TEST_RESULT=$?
146+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} nginx

0 commit comments

Comments
 (0)