| 1 | #!/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_filemd5 { |
| 20 | |
| 21 | probecheck "filemd5" || return 255 |
| 22 | require "md5sum" || return 255 |
| 23 | |
| 24 | local ret_val=0; |
| 25 | local DEFFILE="test_probes_filemd5.xml" |
| 26 | local RESFILE="results.xml" |
| 27 | |
| 28 | [ -f $RESFILE ] && rm -f $RESFILE |
| 29 | |
| 30 | bash ${srcdir}/test_probes_filemd5.xml.sh > $DEFFILE |
| 31 | $OSCAP oval eval --results $RESFILE $DEFFILE |
| 32 | |
| 33 | if [ -f $RESFILE ]; then |
| 34 | verify_results "def" $DF $RF 13 && verify_results "tst" $DF $RF 96 |
| 35 | ret_val=$? |
| 36 | else |
| 37 | ret_val=1 |
| 38 | fi |
| 39 | |
| 40 | return $ret_val |
| 41 | } |
| 42 | |
| 43 | # Testing. |
| 44 | |
| 45 | test_init |
| 46 | |
| 47 | test_run "test_probes_filemd5" test_probes_filemd5 |
| 48 | |
| 49 | test_exit |