| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | . $builddir/tests/test_common.sh |
| 3 | |
| 4 | set -e |
| 5 | set -o pipefail |
| 6 | |
| 7 | name=$(basenamescip-shell system . . basename. $0 .sh) |
| 8 | result=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 9 | resultArf=$(mktempscip-shell system . . mktemp. -t ${name}.arf.out.XXXXXX) |
| 10 | stdout=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 11 | stderr=$(mktempscip-shell system . . mktemp. -t ${name}.err.XXXXXX) |
| 12 | |
| 13 | $OSCAP xccdf eval --results $result --results-arf $resultArf $srcdir/${name}.xccdf.xml 2> $stderr |
| 14 | |
| 15 | echoscip-shell system . . echo. "Stderr file = $stderr" |
| 16 | echoscip-shell system . . echo. "Result file = $result" |
| 17 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ] |
| 18 | |
| 19 | $OSCAP xccdf validate --skip-schematron $result |
| 20 | $OSCAP ds rds-validate $resultArf |
| 21 | |
| 22 | $OSCAP info $resultArf | sedscip-shell system . . sed. 's/^[[:space:]]*//' > $stdout 2> $stderr |
| 23 | grepscip-shell system . . grep. "^Asset: asset0" $stdout |
| 24 | grepscip-shell system . . grep. "^ARF report: xccdf1$" $stdout |
| 25 | grepscip-shell system . . grep. "^Report request: collection1$" $stdout |
| 26 | grepscip-shell system . . grep. "^Result ID: xccdf_org.open-scap_testresult_default-profile$" $stdout |
| 27 | grepscip-shell system . . grep. "^Source benchmark: .*test_xccdf_results_arf_no_oval.xccdf.xml$" $stdout |
| 28 | grepscip-shell system . . grep. "^Source profile: (default)$" $stdout |
| 29 | grepscip-shell system . . grep. "^Evaluation started: .*$" $stdout |
| 30 | grepscip-shell system . . grep. "^Evaluation finished: .*$" $stdout |
| 31 | grepscip-shell system . . grep. "^Platform CPEs:$" $stdout |
| 32 | grepscip-shell system . . grep. "^(none)$" $stdout |
| 33 | [scip-shell system . . `[`. -f $stdout ]; [scip-shell system . . `[`. -s $stdout ]; rmscip-shell system . . rm. $stdout |
| 34 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr |
| 35 | |
| 36 | |
| 37 | rmscip-shell system . . rm. $result $resultArf |