| 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 OVAL Module Test Suite. |
| 7 | # |
| 8 | # Created on: Nov 30, 2009 |
| 9 | # |
| 10 | # Authors: |
| 11 | # Peter Vrabec, <[email protected]> |
| 12 | # Ondrej Moris, <[email protected]> |
| 13 | |
| 14 | . $builddir/tests/test_common.sh |
| 15 | |
| 16 | |
| 17 | # Test Cases. |
| 18 | |
| 19 | function test_api_oval_definitionscip-shell shell shell-project 0.0.0 test_api_oval_definition(). { |
| 20 | ./test_api_oval ${srcdir}/scap-rhel5-oval.xml |
| 21 | } |
| 22 | |
| 23 | function test_api_oval_syscharscip-shell shell shell-project 0.0.0 test_api_oval_syschar(). { |
| 24 | ./test_api_syschar $srcdir/composed-oval.xml \ |
| 25 | $srcdir/system-characteristics.xml |
| 26 | } |
| 27 | |
| 28 | function test_api_oval_resultsscip-shell shell shell-project 0.0.0 test_api_oval_results(). { |
| 29 | ./test_api_results $srcdir/results.xml exported-results.xml |
| 30 | cmpscip-shell system . . cmp. $srcdir/results-good.xml exported-results.xml |
| 31 | } |
| 32 | |
| 33 | function test_api_oval_directivesscip-shell shell shell-project 0.0.0 test_api_oval_directives(). { |
| 34 | ./test_api_directives $srcdir/directives.xml exported-directives.xml |
| 35 | cmpscip-shell system . . cmp. $srcdir/directives.xml exported-directives.xml |
| 36 | } |
| 37 | |
| 38 | # Testing. |
| 39 | |
| 40 | test_init |
| 41 | |
| 42 | if [scip-shell system . . `[`. -z ${CUSTOM_OSCAP+x} ] ; then |
| 43 | test_run "test_api_oval_definition" test_api_oval_definition |
| 44 | test_run "test_api_oval_syschar" test_api_oval_syschar |
| 45 | test_run "test_api_oval_results" test_api_oval_results |
| 46 | test_run "test_api_oval_directives" test_api_oval_directives |
| 47 | fi |
| 48 | |
| 49 | test_exit |