| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | set -e -o pipefail |
| 4 | |
| 5 | . $builddir/tests/test_common.sh |
| 6 | |
| 7 | probecheck "textfilecontent54" || exit 255 |
| 8 | |
| 9 | cpscip-shell system . . cp. $srcdir/30-ospp-v42.rules /tmpscip-shell filesystem . . `/tmp`. |
| 10 | |
| 11 | name=$(basenamescip-shell system . . basename. $0 .sh) |
| 12 | input=$srcdir/$name.oval.xml |
| 13 | result=$(mktempscip-shell system . . mktemp.) |
| 14 | stdout=$(mktempscip-shell system . . mktemp.) |
| 15 | stderr=$(mktempscip-shell system . . mktemp.) |
| 16 | |
| 17 | $OSCAP oval eval --results $result $input > $stdout 2> $stderr |
| 18 | |
| 19 | grepscip-shell system . . grep. -q "Function oscap_pcre_exec() failed to match a regular expression with return code -21" $stderr |
| 20 | |
| 21 | assert_exists 1 '/oval_results/results/system/definitions/definition[@definition_id="oval:x:def:1" and @result="error"]scip-shell filesystem . . `/oval_results/results/system/definitions/definition[@definition_id="oval:x:def:1" and @result="error"]`.' |
| 22 | |
| 23 | co='/oval_results/results/system/oval_system_characteristics/collected_objectsscip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects`.' |
| 24 | assert_exists 1 $co'/object[@flag="error"]' |
| 25 | assert_exists 1 $co'/object/message[@level="error"]' |
| 26 | assert_exists 1 $co'/object/message[text()="Regular expression pattern match failed in file /tmp/30-ospp-v42.rules with error -21."]' |
| 27 | |
| 28 | rmscip-shell system . . rm. -f /tmp/30-ospp-v42.rulesscip-shell filesystem . . `/tmp/30-ospp-v42.rules`. |
| 29 | rmscip-shell system . . rm. -f $result |
| 30 | rmscip-shell system . . rm. -f $stdout |
| 31 | rmscip-shell system . . rm. -f $stderr |