openscap icon indicating copy to clipboard operation
openscap copied to clipboard

tests: Don't set -e for compound tests managed by test_run

Open evgenyz opened this issue 11 months ago • 2 comments

The test_run wrapper should handle all return codes, we don't want to bail out early.

Fixes: https://github.com/OpenSCAP/openscap/issues/2110

evgenyz avatar Jan 11 '25 10:01 evgenyz

@jan-cerny In this draft I've only changed a handful of compound tests, but we probably should do that to all of them. What do you think?

evgenyz avatar Jan 11 '25 10:01 evgenyz

IIUC most of the test functions don't return any return value, they rely on that the set -e will cause that once any command in the function returns non-zero value the test will exit and fail. This is the case for all the grep, assert_exists and similar calls. So if you remove set -e the test will start passing permanently.

jan-cerny avatar Jan 13 '25 12:01 jan-cerny