| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | # Test to check usage of SCE in DS |
| 4 | # |
| 5 | # Author: |
| 6 | # Zbynek Moravec <[email protected]> |
| 7 | |
| 8 | . $builddir/tests/test_common.sh |
| 9 | |
| 10 | set -e -o pipefail |
| 11 | |
| 12 | function test_sce_in_dsscip-shell shell shell-project 0.0.0 test_sce_in_ds(). { |
| 13 | |
| 14 | xccdf_file=${srcdir}/$1 |
| 15 | stderr=$(mktempscip-shell system . . mktemp.) |
| 16 | result=$(mktempscip-shell system . . mktemp.) |
| 17 | |
| 18 | $OSCAP xccdf eval --results "$result" "$xccdf_file" 2> $stderr |
| 19 | |
| 20 | assert_exists 1 "//result[text()='pass']" |
| 21 | |
| 22 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr |
| 23 | [scip-shell system . . `[`. -f $result ]; [scip-shell system . . `[`. -s $result ]; rmscip-shell system . . rm. $result |
| 24 | } |
| 25 | |
| 26 | # Testing. |
| 27 | test_init |
| 28 | |
| 29 | test_run "SCE in DS" test_sce_in_ds test_sce_in_ds.xml |
| 30 | |
| 31 | test_exit |