Debian Codegraph @

tests/API/XCCDF/unittests/test_xccdf_check_without_content_refs.sh

raw symbols SCIP
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_without_content_refs.xccdf.xml 2> $stderr || [scip-shell system . . `[`. $? == 2 ]
11
12 echoscip-shell system . . echo. "Stderr file = $stderr"
13 echoscip-shell system . . echo. "Result file = $result"
14 [scip-shell system . . `[`. -f $stderr ]
15 grepscip-shell system . . grep. "Skipping rule that uses OVAL but is possibly malformed; an incorrect content reference prevents this check from being evaluated." $stderr
16 rmscip-shell system . . rm. $stderr
17
18 $OSCAP xccdf validate --skip-schematron $result
19
20 assert_exists 1 '/Benchmark/status[not(@date)]scip-shell filesystem . . `/Benchmark/status[not(@date)]`.'
21 assert_exists 1 '//rule-result'
22 assert_exists 1 '//rule-result[@idref="def-20120006"]/result[text()="notchecked"]'
23 assert_exists 0 '//rule-result/check/check-content-ref'
24 assert_exists 0 '//check[@multi-check]'
25 assert_exists 1 '/Benchmark/TestResult/score[@system="urn:xccdf:scoring:default"][text()="0.000000"]scip-shell filesystem . . `/Benchmark/TestResult/score[@system="urn:xccdf:scoring:default"][text()="0.000000"]`.'
26 rmscip-shell system . . rm. $result