Debian Codegraph @

tests/probes/maskattr/test_object_entity_nomask.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 -o pipefail
6
7 function perform_testscip-shell shell shell-project 0.0.0 perform_test(). {
8 probecheck "file" || return 255
9
10 name=$(basenamescip-shell system . . basename. $0 .sh)
11 result=$(mktempscip-shell system . . mktemp. ${name}.out.XXXXXX)
12 echoscip-shell system . . echo. "Result file: $result"
13
14 echoscip-shell system . . echo. "Evaluating content."
15 $OSCAP oval eval --results $result $srcdir/${name}.xml || [scip-shell system . . `[`. $? == 2 ]
16
17 echoscip-shell system . . echo. "Validating results."
18 $OSCAP oval validate --results $result
19
20 echoscip-shell system . . echo. "Testing results values."
21 [scip-shell system . . `[`. "$($XPATH $result 'string(/oval_results/results/system/tests/test[@test_id="oval:x:tst:1"]/@result)')" == "true" ]
22
23 echoscip-shell system . . echo. "Testing syschar values."
24 [scip-shell system . . `[`. "$($XPATH $result 'string(/oval_results/results/system/oval_system_characteristics/collected_objects/object[@id="oval:x:obj:1"]/@flag)')" == "complete" ]
25 [scip-shell system . . `[`. "$($XPATH $result 'count(/oval_results/results/system/oval_system_characteristics/collected_objects/object[@id="oval:x:obj:1"]/reference)')" == "1" ]
26
27 [scip-shell system . . `[`. "$($XPATH $result 'boolean(/oval_results/results/system/oval_system_characteristics/system_data/unix-sys:file_item/unix-sys:filepath/@mask)')" == "0" ]
28 [scip-shell system . . `[`. "$($XPATH $result 'string(/oval_results/results/system/oval_system_characteristics/system_data/unix-sys:file_item/unix-sys:filepath)')" == "/etc/passwdscip-shell filesystem . . `/etc/passwd`." ]
29
30 rmscip-shell system . . rm. $result
31 }
32
33 perform_testscip-shell shell shell-project 0.0.0 perform_test().