Debian Codegraph @

tests/API/OVAL/unittests/test_directives.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2
3 # Test basic usage of OVAL Directives. OVAL Directives here are used to exclude
4 # <definitions> element from the resulting OVAL Results file.
5
6 . $builddir/tests/test_common.sh
7
8 set -e -o pipefail
9
10 name=$(basename $0 .sh)
11 result=$(mktemp ${name}.out.XXXXXX)
12 stderr=$(mktemp ${name}.err.XXXXXX)
13
14 $OSCAP oval eval --results $result --directives $srcdir/$name.xml $srcdir/comment.xml 2> $stderr
15 [ -f $stderr ]; [ ! -s $stderr ]; rm $stderr
16 [ -f $result ]
17
18 assert_exists 0 '/oval_results/oval_definitions'
19 assert_exists 1 '/oval_results/directives[@include_source_definitions="false"]'
20 assert_exists 1 '/oval_results/directives/definition_true[@reported="true" and @content="full"]'
21 assert_exists 1 '/oval_results/directives/definition_false[@reported="true" and @content="full"]'
22 assert_exists 1 '/oval_results/directives/definition_unknown[@reported="true" and @content="full"]'
23 assert_exists 1 '/oval_results/directives/definition_error[@reported="true" and @content="full"]'
24 assert_exists 1 '/oval_results/directives/definition_not_evaluated[@reported="true" and @content="full"]'
25 assert_exists 1 '/oval_results/directives/definition_not_applicable[@reported="true" and @content="full"]'
26
27 rm $result