Debian Codegraph @

tests/API/XCCDF/unittests/test_xccdf_overrides.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 . $builddir/tests/test_common.sh
4
5 set -e
6 set -o pipefail
7
8 name=$(basenamescip-shell system . . basename. $0 .sh)
9
10 ./${name} ${srcdir}/${name}.arf.xml
11
12 result="${name}.xml.out"
13 echoscip-shell system . . echo. "Result file = $result"
14 [scip-shell system . . `[`. -f "$result" ]
15 stderr=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX)
16 echoscip-shell system . . echo. "Stderr file = $stderr"
17
18 $OSCAP info $result 2> $stderr
19 [scip-shell system . . `[`. ! -s $stderr ]
20
21 $OSCAP ds rds-validate $result 2> $stderr
22 [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr
23
24 assert_exists 1 '//TestResult'
25 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]'
26 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/result'
27 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/result[text()="pass"]'
28 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override'
29 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override[@date]'
30 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override[@authority]'
31 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override/old-result'
32 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override/old-result[text()="fail"]'
33 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override/new-result'
34 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override/new-result[text()="pass"]'
35 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override/remark'
36 assert_exists 1 '//TestResult/rule-result[@idref="xccdf_org.ssgproject.content_rule_disable_prelink"]/override/remark[text()="I believe this should have passed"]'
37
38 rmscip-shell system . . rm. $result