Debian Codegraph @

tests/probes/selinuxboolean/test_probes_selinuxboolean.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 # Copyright 2011 Red Hat Inc., Durham, North Carolina.
4 # All Rights Reserved.
5 #
6 # OpenScap Probes Test Suite.
7 #
8 # Created on: Nov 30, 2009
9 #
10 # Authors:
11 # Peter Vrabec, <[email protected]>
12 # David Niemoller
13 # Ondrej Moris, <[email protected]>
14 # Petr Lautrbach <[email protected]>
15
16 . $builddir/tests/test_common.sh
17
18 # Test Cases.
19
20 function test_probes_selinuxbooleanscip-shell shell shell-project 0.0.0 test_probes_selinuxboolean(). {
21 # if the user doesn't have SELinux enabled we will skip the test
22 selinuxenabled || return 255
23
24 probecheck "selinuxboolean" || return 255
25
26 local ret_val=0;
27 local DF="$1.xml"
28 local RF="$1.results.xml"
29 local stderr=$(mktempscip-shell system . . mktemp. $1.err.XXXXXX)
30 echoscip-shell system . . echo. "stderr file: $stderr"
31
32 [scip-shell system . . `[`. -f $RF ] && rmscip-shell system . . rm. -f $RF
33
34 bashscip-shell system . . bash. ${srcdir}/$1.xml.sh > $DF
35 LINES=$?
36
37 $OSCAP oval eval --results $RF $DF 2>$stderr
38
39 if [scip-shell system . . `[`. -f $RF ]; then
40 verify_results "def" $DF $RF 1 && verify_results "tst" $DF $RF $LINES
41 ret_val=$?
42 else
43 ret_val=1
44 fi
45
46 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!"
47 rmscip-shell system . . rm. $stderr
48
49 return $ret_val
50 }
51
52 # Testing.
53
54 test_init
55
56 test_run "test_probes_selinuxboolean" test_probes_selinuxboolean \
57 test_probes_selinuxboolean
58 test_run "test_probes_selinuxboolean-fail" test_probes_selinuxboolean \
59 test_probes_selinuxboolean-fail
60
61 test_exit