Skip to content

Commit 203de58

Browse files
committed
Generate certs so that we can concurently test dif curl, wolfssl, and WPFF refs
1 parent 75c0f5e commit 203de58

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ if [ "$WOLFPROV_FORCE_FAIL" = "1" ]; then
3131
EXPECTED_FAILS="9 31 39 41 44 46 61 64 65 70 71 72 73 88 153 154 158 163 166 167 168 169 170 171 173 186 206 245 246 258 259 273 277 327 335 388 420 444 540 551 552 554 565 579 584 643 645 646 647 648 649 650 651 652 653 654 666 667 668 669 670 671 672 673 977 1001 1002 1030 1053 1060 1061 1071 1072 1079 1095 1105 1133 1136 1151 1155 1158 1160 1161 1186 1187 1189 1190 1191 1192 1193 1194 1195 1196 1198 1199 1229 1284 1285 1286 1293 1315 1404 1412 1415 1418 1437 1568 1903 1905 1916 1917 1964 2024 2026 2027 2028 2030 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2073 2076 2200 2201 2202 2203 2204 3017 3018"
3232
;;
3333
"master")
34-
# TODO: Replace with actual master branch expected failures
3534
EXPECTED_FAILS="9 31 39 41 44 46 61 64 65 70 71 72 73 88 153 154 158 163 166 167 168 169 170 171 173 186 206 245 246 258 259 273 277 327 335 388 420 444 483 540 551 552 554 565 579 584 643 645 646 647 648 649 650 651 652 653 654 666 667 668 669 670 671 672 673 695 977 1001 1002 1030 1053 1060 1061 1071 1072 1079 1095 1105 1133 1136 1151 1155 1158 1160 1161 1186 1187 1189 1190 1191 1192 1193 1194 1195 1196 1198 1199 1229 1284 1285 1286 1293 1315 1404 1412 1415 1418 1437 1476 1568 1608 1610 1615 1654 1660 1903 1905 1916 1917 1964 2024 2026 2027 2028 2030 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2073 2076 2200 2201 2202 2203 2204 3017 3018"
3635
;;
3736
*)
@@ -45,9 +44,12 @@ if [ "$WOLFPROV_FORCE_FAIL" = "1" ]; then
4544
ACTUAL_SORTED="${TEMP_DIR}/actual_sorted.txt"
4645
EXPECTED_SORTED="${TEMP_DIR}/expected_sorted.txt"
4746

48-
# Sort both lists, one per line
49-
echo "$ACTUAL_FAILS" | tr ' ' '\n' | sort -n > "$ACTUAL_SORTED"
50-
echo "$EXPECTED_FAILS" | tr ' ' '\n' | sort -n > "$EXPECTED_SORTED"
47+
# Clean and sort both lists and remove empty lines
48+
echo "$ACTUAL_FAILS" | tr ' ' '\n' | grep -v '^$' | sort -n > "$ACTUAL_SORTED"
49+
echo "$EXPECTED_FAILS" | tr ' ' '\n' | grep -v '^$' | sort -n > "$EXPECTED_SORTED"
50+
51+
echo "DEBUG: Sorted actual fails: $(tr '\n' ' ' < "$ACTUAL_SORTED")"
52+
echo "DEBUG: Sorted expected fails: $(tr '\n' ' ' < "$EXPECTED_SORTED")"
5153

5254
# Find missing in actual (in expected but not in actual)
5355
MISSING=$(comm -23 "$EXPECTED_SORTED" "$ACTUAL_SORTED" | tr '\n' ' ')
@@ -60,8 +62,7 @@ if [ "$WOLFPROV_FORCE_FAIL" = "1" ]; then
6062
echo "Test(s) that should have failed: $MISSING"
6163
echo "Test(s) that shouldn't have failed: $EXTRA"
6264

63-
# Check if they match by comparing the original sorted files
64-
if [ "$ACTUAL_FAILS" = "$EXPECTED_FAILS" ]; then
65+
if [ -z "$MISSING" ] && [ -z "$EXTRA" ]; then
6566
echo "PASS: Actual failed tests match expected."
6667
exit 0
6768
else

.github/workflows/curl.yml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
matrix:
7474
curl_ref: [ 'master', 'curl-8_4_0' ]
7575
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
76+
force_fail: [ 1, 0 ]
7677
steps:
7778
- name: Checkout wolfProvider
7879
uses: actions/checkout@v4
@@ -115,34 +116,26 @@ jobs:
115116
configure: --with-openssl
116117
check: false
117118

118-
- name: Test curl with wolfProvider - default
119-
working-directory: curl
119+
- name: Generate certificates for force-fail tests
120120
run: |
121-
# Set environment variables for default
122-
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
123-
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
124-
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
125-
export PKG_CONFIG_PATH=$GITHUB_WORKSPACE/openssl-install/lib64/pkgconfig
126-
127-
# Run tests
128-
make -j$(nproc) test-ci || true
129-
TEST_RESULT=$?
130-
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT 0 curl
121+
if [ "${{ matrix.force_fail }}" = "1" ]; then
122+
cd curl/tests/certs
123+
make test-ca.cacert
124+
cd ../..
125+
fi
131126
132-
# Test WPFF after default so certs get generated
133-
- name: Test curl with wolfProvider - force fail
127+
- name: Test curl with wolfProvider
134128
working-directory: curl
135129
run: |
136-
# Set environment variables for force fail
130+
# Set environment variables
137131
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
138132
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
139133
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
140134
export PKG_CONFIG_PATH=$GITHUB_WORKSPACE/openssl-install/lib64/pkgconfig
141-
export WOLFPROV_FORCE_FAIL=1
135+
export WOLFPROV_FORCE_FAIL=${{ matrix.force_fail }}
142136
export CURL_REF=${{ matrix.curl_ref }}
143137
144-
# Run tests and save output to test.log
145-
mkdir -p tests
146-
make -j$(nproc) test-ci 2>&1 | tee tests/test.log || true
138+
# Run tests
139+
make -j$(nproc) test-ci || true
147140
TEST_RESULT=$?
148-
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT 1 curl
141+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} curl

0 commit comments

Comments
 (0)