| 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 | set -x |
| 7 | |
| 8 | name=$(basenamescip-shell system . . basename. $0 .sh) |
| 9 | |
| 10 | result=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 11 | stderr=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 12 | |
| 13 | $OSCAP xccdf eval --results $result --profile RHEL6-Default $srcdir/${name}.xccdf.xml 2> $stderr || ret=$? |
| 14 | |
| 15 | echoscip-shell system . . echo. "Stderr file = $stderr" |
| 16 | echoscip-shell system . . echo. "Result file = $result" |
| 17 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr |
| 18 | |
| 19 | $OSCAP xccdf validate --skip-schematron $result |
| 20 | |
| 21 | assert_exists 1 '//rule-result' |
| 22 | assert_exists 1 '//rule-result/result' |
| 23 | assert_exists 1 '//rule-result/check' |
| 24 | assert_exists 1 '//rule-result/check[@system="http://oval.mitre.org/XMLSchema/oval-definitions-5"]' |
| 25 | |
| 26 | assert_exists 1 '//rule-result/check/check-content-ref' |
| 27 | assert_exists 1 '//rule-result/check/check-content-ref[@href="test_empty_variable.oval.xml"]' |
| 28 | |
| 29 | |
| 30 | rmscip-shell system . . rm. $result |