| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | . $builddir/tests/test_common.sh |
| 3 | |
| 4 | set -e |
| 5 | set -o pipefail |
| 6 | |
| 7 | name=$(basenamescip-shell system . . basename. $0 .sh) |
| 8 | |
| 9 | result=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 10 | stderr=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 11 | |
| 12 | $OSCAP xccdf eval --results $result $srcdir/${name}.xccdf.xml 2> $stderr |
| 13 | |
| 14 | echoscip-shell system . . echo. "Stderr file = $stderr" |
| 15 | echoscip-shell system . . echo. "Result file = $result" |
| 16 | [scip-shell system . . `[`. -f $stderr ] |
| 17 | [scip-shell system . . `[`. "WARNING: Skipping $srcdir/_non_existent_.oval.xml file which is referenced from XCCDF content" == "`catscip-shell system . . cat. $stderr`" ] |
| 18 | rmscip-shell system . . rm. $stderr |
| 19 | |
| 20 | $OSCAP xccdf validate --skip-schematron $result |
| 21 | |
| 22 | assert_exists 2 '//complex-check' |
| 23 | assert_exists 2 '//complex-check[@operator="AND"]' |
| 24 | assert_exists 1 '//rule-result' |
| 25 | assert_exists 1 '//rule-result/result' |
| 26 | assert_exists 1 '//rule-result/result[text()="notchecked"]' |
| 27 | assert_exists 1 '//rule-result/complex-check' |
| 28 | assert_exists 1 '//rule-result/complex-check[@operator="AND"]' |
| 29 | assert_exists 2 '//rule-result/complex-check/check' |
| 30 | assert_exists 2 '//rule-result/complex-check/check/check-content-ref' |
| 31 | assert_exists 1 '//score' |
| 32 | assert_exists 1 '//score[text()="0.000000"]' |
| 33 | rmscip-shell system . . rm. $result |