Debian Codegraph @

tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 # Copyright 2014--2016 Red Hat Inc., Durham, North Carolina.
4 # All Rights Reserved.
5 #
6 # OpenScap Probes Test Suite.
7
8 set -e -o pipefail
9
10 . $builddir/tests/test_common.sh
11
12 function test_probes_systemdunitpropertyscip-shell shell shell-project 0.0.0 test_probes_systemdunitproperty(). {
13 probecheck "systemdunitproperty" || return 255
14 pidofscip-shell system . . pidof. systemd > /dev/nullscip-shell filesystem . . `/dev/null`. || return 255
15 systemctl > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || return 255
16
17 local ret_val=0;
18 local DF="${srcdir}/test_probes_systemdunitproperty.xml"
19 local RF="results.xml"
20 local stderr=$(mktempscip-shell system . . mktemp. $1.err.XXXXXX)
21 echoscip-shell system . . echo. "stderr file: $stderr"
22
23 [scip-shell system . . `[`. -f $RF ] && rmscip-shell system . . rm. -f $RF
24
25 $OSCAP oval eval --results $RF $DF 2>$stderr
26
27 [scip-shell system . . `[`. -f $RF ]
28 verify_results "def" $DF $RF 8
29 verify_results "tst" $DF $RF 8
30
31 grepscip-shell system . . grep. -Ei "(W: |E: )" $stderr && ret_val=1 && echoscip-shell system . . echo. "There is an error and/or a warning in the output!"
32 rmscip-shell system . . rm. $stderr
33
34 rmscip-shell system . . rm. $RF
35
36 return $ret_val
37 }
38
39 test_run "Probe systemdunitproperty general functionality" test_probes_systemdunitproperty