1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/usr/bin/env bash
. $builddir/tests/test_common.sh
set -e
set -o pipefail
name=$(basename $0 .sh)
result=$(mktemp -t ${name}.out.XXXXXX)
stderr=$(mktemp -t ${name}.out.XXXXXX)
$OSCAP xccdf eval --profile xccdf_moc.elpmaxe.www_profile_1 --results $result $srcdir/${name}.xccdf.xml 2> $stderr
echo "Stderr file = $stderr"
echo "Result file = $result"
grep "Skipping rule that requires an unregistered check system or incorrect content reference to evaluate." $stderr
rm $stderr
$OSCAP xccdf validate --skip-schematron $result
assert_exists 1 '//rule-result'
assert_exists 1 '//rule-result/result'
assert_exists 1 '//rule-result/result[text()="notchecked"]'
assert_exists 1 '//rule-result/message'
assert_exists 1 '//rule-result/message[@severity="info"]'
assert_exists 1 '//rule-result/message[text()="No candidate or applicable check found."]'
assert_exists 0 '//rule-result/check'
rm $result
|