| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | # Copyright 2009 Red Hat Inc., Durham, North Carolina. |
| 4 | # All Rights Reserved. |
| 5 | # |
| 6 | # OpenScap Probes Test Suite. |
| 7 | # |
| 8 | # Created on: Nov 30, 2009 |
| 9 | # |
| 10 | # Authors: |
| 11 | # Peter Vrabec, <[email protected]> |
| 12 | # David Niemoller |
| 13 | # Ondrej Moris, <[email protected]> |
| 14 | |
| 15 | . $builddir/tests/test_common.sh |
| 16 | |
| 17 | # Test Cases. |
| 18 | |
| 19 | function test_probes_environmentvariablescip-shell shell shell-project 0.0.0 test_probes_environmentvariable(). { |
| 20 | |
| 21 | probecheck "environmentvariable" || return 255 |
| 22 | |
| 23 | local ret_val=0; |
| 24 | local DF="$1.xml" |
| 25 | local RF="$1.results.xml" |
| 26 | |
| 27 | [scip-shell system . . `[`. -f $RF ] && rmscip-shell system . . rm. -f $RF |
| 28 | |
| 29 | bashscip-shell system . . bash. ${srcdir}/$1.xml.sh > $DF |
| 30 | LINES=$? |
| 31 | |
| 32 | $OSCAP oval eval --results $RF $DF |
| 33 | |
| 34 | if [scip-shell system . . `[`. -f $RF ]; then |
| 35 | verify_results "def" $DF $RF 1 && verify_results "tst" $DF $RF $LINES |
| 36 | ret_val=$? |
| 37 | else |
| 38 | ret_val=1 |
| 39 | fi |
| 40 | |
| 41 | return $ret_val |
| 42 | } |
| 43 | |
| 44 | # Testing. |
| 45 | |
| 46 | test_init |
| 47 | |
| 48 | test_run "test_probes_environmentvariable" test_probes_environmentvariable \ |
| 49 | test_probes_environmentvariable |
| 50 | test_run "test_probes_environmentvariable-fail" test_probes_environmentvariable \ |
| 51 | test_probes_environmentvariable-fail |
| 52 | |
| 53 | test_exit |