Debian Codegraph @

tests/API/XCCDF/unittests/test_xccdf_check_negate.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_negate.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 '//complex-check'
19 assert_exists 1 '//Rule/check[@negate="true"]'
20 assert_exists 1 '//rule-result/check[@negate="true"]'
21 assert_exists 1 '//rule-result[@idref="xccdf_moc.elpmaxe.www_rule_1"]/result[text()="pass"]'
22 rmscip-shell system . . rm. $result