Debian Codegraph @

tests/probes/sysctl/test_sysctl_probe.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 perform_testscip-shell shell shell-project 0.0.0 perform_test(). {
8 probecheck "sysctl" || return 255
9
10 result=`mktempscip-shell system . . mktemp.`
11 stderr=`mktempscip-shell system . . mktemp.`
12 hostname=`hostnamescip-shell system . . hostname.`
13 case $(unamescip-shell system . . uname.) in
14 FreeBSD)
15 $OSCAP oval eval --results $result $srcdir/test_sysctl_probe_freebsd.oval.xml 2>$stderr
16 ;;
17 *)
18 $OSCAP oval eval --results $result $srcdir/test_sysctl_probe.oval.xml 2>$stderr
19 ;;
20 esac
21
22 [scip-shell system . . `[`. ! -s $stderr ]
23 case $(unamescip-shell system . . uname.) in
24 FreeBSD)
25 assert_exists 1 "/oval_results/results/system/oval_system_characteristics/system_data/unix-sys:sysctl_item/unix-sys:name[text()='kern.hostname']"
26 assert_exists 1 "/oval_results/results/system/oval_system_characteristics/system_data/unix-sys:sysctl_item/unix-sys:value[text()='$hostname']"
27 ;;
28 *)
29 assert_exists 1 "/oval_results/results/system/oval_system_characteristics/system_data/unix-sys:sysctl_item/unix-sys:name[text()='kernel.hostname']"
30 assert_exists 1 "/oval_results/results/system/oval_system_characteristics/system_data/unix-sys:sysctl_item/unix-sys:value[text()='$hostname']"
31 ;;
32 esac
33
34 rmscip-shell system . . rm. $result
35 rmscip-shell system . . rm. $stderr
36 }
37
38 perform_testscip-shell shell shell-project 0.0.0 perform_test().