Debian Codegraph @

tests/DS/test_sds_fix_from_source.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 # Author:
4 # Martin Preisler <[email protected]>
5
6 set -e -o pipefail
7
8 . $builddir/tests/test_common.sh
9
10 # Test Cases.
11
12 function test_generate_fix_sourcescip-shell shell shell-project 0.0.0 test_generate_fix_source(). {
13 local fixfile=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX)
14
15 # all rules (default profile)
16 $OSCAP xccdf generate fix --output $fixfile "${srcdir}/$1"
17 grepscip-shell system . . grep. -q remediation_rule_applicable_pass $fixfile
18 grepscip-shell system . . grep. -q remediation_rule_applicable_fail $fixfile
19 grepscip-shell system . . grep. -q remediation_rule_notapplicable $fixfile
20 rmscip-shell system . . rm. $fixfile
21
22 # selected profile
23 $OSCAP xccdf generate fix --output $fixfile --profile xccdf_org.ssgproject.content_profile_test "${srcdir}/$1"
24 grepscip-shell system . . grep. -qv remediation_rule_applicable_pass $fixfile
25 grepscip-shell system . . grep. -q remediation_rule_applicable_fail $fixfile
26 grepscip-shell system . . grep. -q remediation_rule_notapplicable $fixfile
27 rmscip-shell system . . rm. $fixfile
28 }
29
30 # Testing.
31 test_init
32
33 test_run "generate_fix_cpe_source" test_generate_fix_source eval_cpe/sds.xml
34
35 test_exit