| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -e -o pipefail |
| 4 | |
| 5 | . $builddir/tests/test_common.sh |
| 6 | |
| 7 | # oscap is expcted to fail here. |
| 8 | # Turn off pipefail, run the cmd, the return code and return to safety. |
| 9 | set +e +o pipefail |
| 10 | $OSCAP info "${top_srcdir}/tests/CPE/openscap_2285_regression.xml" |
| 11 | rc=$? |
| 12 | set -e -o pipefail |
| 13 | |
| 14 | |
| 15 | if [ "$rc" -eq 139 ]; then |
| 16 | echo "oscap seg-faulted (exit status 139)" |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | if [ "$rc" -eq 0 ]; then |
| 21 | echo "oscap did not error as expected" |
| 22 | exit 1 |
| 23 | fi |