Skip to content

Commit dc041ae

Browse files
Fix: gtests no exit mode not reporting failures
Gtests failures were not reported while running the nightly test mode, fix via correctly returning status in no EXIT_ON_FAILURE mode. Add the missing dma mode.
1 parent 60243be commit dc041ae

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/scripts/gtest.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bind_driver_to_dpdk() {
116116
sed -i "s+REPLACE_BY_CICD_TEST_PORT_2+${TEST_PORT_2}+" "$MUFD_CFG"
117117
echo "Selected ports: P=$TEST_PORT_1, R=$TEST_PORT_2"
118118

119-
for dma_mechanism in "CBDMA" "idxd"; do
119+
for dma_mechanism in "CBDMA" "idxd" "ioatdma"; do
120120
TEST_DMA_PORT_P=$(dpdk-devbind.py -s | grep "$dma_mechanism" | awk '{print $1}' | shuf -n 1)
121121
TEST_DMA_PORT_R=$(dpdk-devbind.py -s | grep "$dma_mechanism" | grep -v "${TEST_DMA_PORT_P}" | awk '{print $1}' | shuf -n 1)
122122
if [ -n "$TEST_DMA_PORT_P" ] && [ -n "$TEST_DMA_PORT_R" ]; then
@@ -170,6 +170,8 @@ declare -a error_messages=(
170170
"Error: ufd_parse_json, open json file ufd.json fail"
171171
"libmtl.so: cannot open shared object file:"
172172
"EAL: Cannot set up DMA remapping, error 12 (Cannot allocate memory)"
173+
"Error: mt_user_params_check, same name for port 1 and 0"
174+
"Error: mt_user_params_check(1), invalid ip 0.0.0.0"
173175
)
174176

175177
check_configuration_errors() {
@@ -217,7 +219,7 @@ run_test_with_retry() {
217219
echo "✗ Test failed due to configuration errors: $test_name (attempt $attempt/$MAX_RETRIES)" | tee -a "$LOG_FILE"
218220
return 2
219221
else
220-
echo "Test failed: $test_name (attempt $attempt/$MAX_RETRIES) | tee -a $LOG_FILE"
222+
echo "Attempt failed for $test_name (attempt $attempt/$MAX_RETRIES)" | tee -a "$LOG_FILE"
221223

222224
kill_test_processes
223225

@@ -234,14 +236,15 @@ run_test_with_retry() {
234236
fi
235237
done
236238

237-
echo "✗ Test failed after $MAX_RETRIES attempts: $test_name | tee -a $LOG_FILE"
239+
echo "✗ Test failed after $MAX_RETRIES attempts: $test_name" | tee -a "$LOG_FILE"
238240

239241
if [ "$EXIT_ON_FAILURE" -eq 1 ]; then
240242
echo "Exiting due to test failure."
241243
kill_test_processes
242244
time_taken_by_script
243245
exit 1
244246
fi
247+
return 1
245248
}
246249

247250
echo "Starting MTL test suite..."
@@ -284,15 +287,13 @@ for test_name in "${!test_cases[@]}"; do
284287
echo "$test_name" "${test_cases[$test_name]}"
285288
if run_test_with_retry "$test_name"; then
286289
passed_tests+=("$test_name")
287-
echo "✓ Test passed: $test_name"
288290
elif [ $? -eq 2 ]; then
289291
echo "✗ Test aborted due to configuration errors: $test_name"
290292
kill_test_processes
291293
time_taken_by_script
292294
exit 1
293295
else
294296
failed_tests+=("$test_name")
295-
break
296297
fi
297298
done
298299

0 commit comments

Comments
 (0)