| 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 | result=`mktempscip-shell system . . mktemp.` |
| 8 | stderr=`mktempscip-shell system . . mktemp.` |
| 9 | |
| 10 | $OSCAP xccdf eval --results $result $srcdir/test_xccdf_check_multi_check.xccdf.xml 2> $stderr |
| 11 | |
| 12 | echoscip-shell system . . echo. "Stderr file = $stderr" |
| 13 | echoscip-shell system . . echo. "Result file = $result" |
| 14 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr |
| 15 | |
| 16 | $OSCAP xccdf validate --skip-schematron $result |
| 17 | |
| 18 | assert_exists 0 '//check[not(@multi-check)]' |
| 19 | assert_exists 1 '//Rule[@id="xccdf_moc.elpmaxe.www_rule_1"]/check[@multi-check="true"]' |
| 20 | assert_exists 1 '//Rule[@id="xccdf_moc.elpmaxe.www_rule_2"]/check[@multi-check="true"]' |
| 21 | assert_exists 1 '//Rule[@id="xccdf_moc.elpmaxe.www_rule_3"]/check[@multi-check="false"]' |
| 22 | assert_exists 1 '//Rule[@id="xccdf_moc.elpmaxe.www_rule_4"]/check[@multi-check="false"]' |
| 23 | rmscip-shell system . . rm. $result |