Debian Codegraph @

tests/API/XCCDF/unittests/test_xccdf_selectors_cluster1.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}.err.XXXXXX)
11
12 $OSCAP xccdf eval --profile xccdf_moc.elpmaxe.www_profile_1 --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 ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr
17
18 $OSCAP xccdf validate --skip-schematron $result
19
20 assert_exists 1 '//Profile'
21 assert_exists 2 '//Profile/select'
22 assert_exists 1 '//Profile/select[@selected="true"]'
23 assert_exists 1 '//Profile/select[@selected="false"]'
24 assert_exists 1 '//rule-result'
25 assert_exists 1 '//rule-result/result'
26 assert_exists 1 '//rule-result/result[text()="notselected"]'
27 assert_exists 1 '//score'
28 assert_exists 1 '//score[text()="0.000000"]'
29 rmscip-shell system . . rm. $result