Debian Codegraph @

tests/probes/process58/empty_proc.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 # This is regression test of RHBZ #2008922
4
5 set -e -o pipefail
6
7 . $builddir/tests/test_common.sh
8 probecheck "process58" || exit 255
9
10 name=$(basenamescip-shell system . . basename. $0 .sh)
11 result=$(mktempscip-shell system . . mktemp. ${name}.out.XXXXXX)
12 stderr=$(mktempscip-shell system . . mktemp. ${name}.err.XXXXXX)
13
14 root=$(mktempscip-shell system . . mktemp. -d)
15
16 # create an empty /proc in the offline file system dir
17 mkdirscip-shell system . . mkdir. -p "$root/proc"
18
19 export OSCAP_PROBE_ROOT="$root"
20 $OSCAP oval eval --results $result $srcdir/capability.oval.xml 2> $stderr
21
22 [scip-shell system . . `[`. $? -eq 0 ]
23 grepscip-shell system . . grep. -q "^W: oscap:\s\+No data about processes could be read from '$root/proc'." "$stderr"
24 grepscip-shell system . . grep. -q "OpenSCAP Error: Probe at sd=1 (process58) reported an error: Operation not permitted" "$stderr" && falsescip-shell system . . false.
25 grepscip-shell system . . grep. -q "W: oscap:\s\+Can't receive message: 125, Operation canceled." "$stderr" && falsescip-shell system . . false.
26
27 [scip-shell system . . `[`. -s "$result" ]
28 assert_exists 1 '/oval_results/results/system/definitions/definition[@result="false"]scip-shell filesystem . . `/oval_results/results/system/definitions/definition[@result="false"]`.'
29 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object[@flag="does not exist"]scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object[@flag="does not exist"]`.'
30
31 rmscip-shell system . . rm. "$stderr"
32 rmscip-shell system . . rm. "$result"
33 rmscip-shell system . . rm. -r "$root"