| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | set -e -o pipefail |
| 4 | |
| 5 | . $builddir/tests/test_common.sh |
| 6 | |
| 7 | report=$(mktempscip-shell system . . mktemp.) |
| 8 | stdout=$(mktempscip-shell system . . mktemp.) |
| 9 | stderr=$(mktempscip-shell system . . mktemp.) |
| 10 | $OSCAP xccdf eval --report $report $srcdir/ds.xml > $stdout 2> $stderr || ret=$? |
| 11 | [scip-shell system . . `[`. $ret = 2 ] |
| 12 | [scip-shell system . . `[`. ! -s $stderr ] |
| 13 | [scip-shell system . . `[`. -f $report ] |
| 14 | [scip-shell system . . `[`. -s $report ] |
| 15 | grepscip-shell system . . grep. -q "Title\s*Simple rule" $stdout |
| 16 | grepscip-shell system . . grep. -q "Result\s*fail" $stdout |
| 17 | grepscip-shell system . . grep. -q "OpenSCAP Evaluation Report" $report |
| 18 | grepscip-shell system . . grep. -q "oval:x:var:1.*42" $report |
| 19 | rmscip-shell system . . rm. -f $report |
| 20 | rmscip-shell system . . rm. -f $stdout |
| 21 | rmscip-shell system . . rm. -f $stderr |