Debian Codegraph @

tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.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 test_probes_fwupdsecattrscip-shell shell shell-project 0.0.0 test_probes_fwupdsecattr(). {
8
9 probecheck "fwupdsecattr" || return 255
10
11 local ret_val=0
12 local DF="${srcdir}/test_probes_fwupdsecattr_mock.xml"
13 local RF="results.xml"
14 local DBUS_MOCK_NAME="org.freedesktop.fwupd"
15 local stderr=$(mktempscip-shell system . . mktemp. test_probes_fwupdsecattr_mock.err.XXXXXX)
16 echoscip-shell system . . echo. "stderr file: $stderr"
17
18 [scip-shell system . . `[`. -f $RF ] && rmscip-shell system . . rm. -f $RF
19
20 init_dbus_mock $DBUS_MOCK_NAME
21 $OSCAP oval eval --results $RF $DF 2>$stderr || truescip-shell system . . true.
22 clean_dbus_mock $DBUS_MOCK_NAME
23
24 if [scip-shell system . . `[`. -f $RF ]; then
25 verify_results "def" $DF $RF 1 && verify_results "tst" $DF $RF 1
26 ret_val=$?
27 else
28 ret_val=1
29 fi
30
31 grepscip-shell system . . grep. -iq "HSI key not found: org.fwupd.hsi.Kernel.InvalidOrNonExisting" $stderr || {
32 ret_val=2
33 echoscip-shell system . . echo. "Expected warning 'HSI key not found: org.fwupd.hsi.Kernel.InvalidOrNonExisting' is missing!"
34 }
35
36 grepscip-shell system . . grep. -iq "Unknown/invalid FwupdSecurityAttrResult value: 200" $stderr || {
37 ret_val=2
38 echoscip-shell system . . echo. "Expected warning 'Unknown/invalid FwupdSecurityAttrResult value: 200' is missing!"
39 }
40
41 return $ret_val
42 }
43
44 test_probes_fwupdsecattrscip-shell shell shell-project 0.0.0 test_probes_fwupdsecattr().