Debian Codegraph @

tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh

raw symbols SCIP
1 #!/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_systemdunitproperty {
13 probecheck "systemdunitproperty" || return 255
14 pidof systemd > /dev/null || return 255
15 systemctl > /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=$(mktemp $1.err.XXXXXX)
21 echo "stderr file: $stderr"
22
23 [ -f $RF ] && rm -f $RF
24
25 $OSCAP oval eval --results $RF $DF 2>$stderr
26
27 [ -f $RF ]
28 verify_results "def" $DF $RF 8
29 verify_results "tst" $DF $RF 8
30
31 grep -Ei "(W: |E: )" $stderr && ret_val=1 && echo "There is an error and/or a warning in the output!"
32 rm $stderr
33
34 rm $RF
35
36 return $ret_val
37 }
38
39 test_run "Probe systemdunitproperty general functionality" test_probes_systemdunitproperty