Debian Codegraph @

tests/API/XCCDF/unittests/test_xccdf_notchecked_has_check.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 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 grepscip-shell system . . grep. "Skipping $srcdir/_non_existent_\.oval\.xml file which is referenced from XCCDF content" $stderr
18 rmscip-shell system . . rm. $stderr
19
20 $OSCAP xccdf validate --skip-schematron $result
21
22 assert_exists 1 '//rule-result'
23 assert_exists 1 '//rule-result/result'
24 assert_exists 1 '//rule-result/result[text()="notchecked"]'
25 assert_exists 0 '//rule-result/check'
26 assert_exists 1 '//score'
27 assert_exists 1 '//score[text()="0.000000"]'
28 rmscip-shell system . . rm. $result