| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Author: |
| 4 | # Peter Vrabec, <[email protected]> |
| 5 | # Daniel Kopecek <[email protected]> |
| 6 | |
| 7 | |
| 8 | . $builddir/tests/test_common.sh |
| 9 | . $srcdir/test_mitre_common.sh |
| 10 | |
| 11 | # Test Cases. |
| 12 | test_init |
| 13 | |
| 14 | # does not work because of symplink `/etc/rc' -> `/etc/rc.d/rc' (oval:org.mitre.oval.test:tst:102) |
| 15 | #test_run "unix-def_file_test.xml" test_mitre unix-def_file_test.xml "true" |
| 16 | |
| 17 | test_run "unix-def_password_test.xml" test_mitre unix-def_password_test.xml "true" |
| 18 | |
| 19 | # these are outdated |
| 20 | #test_run "unix-def_process58_test.xml" test_mitre unix-def_process58_test.xml "true" |
| 21 | #test_run "unix-def_process_test.xml" test_mitre unix-def_process_test.xml "true" |
| 22 | |
| 23 | # Fedora 16 and RHEL-7 - no runlevel |
| 24 | if [[ ( ${DISTRO#Fedora} != "$DISTRO" && $DISTRO_RELEASE -lt 16 ) || \ |
| 25 | ( ${DISTRO#Red Hat} != "$DISTRO" && $DISTRO_RELEASE -lt 7 ) ]]; then |
| 26 | test_run "unix-def_runlevel_test.xml" test_mitre unix-def_runlevel_test.xml "true" |
| 27 | fi |
| 28 | |
| 29 | test_run "unix-def_uname_test.xml" test_mitre unix-def_uname_test.xml "true" |
| 30 | |
| 31 | # needs only two interfaces - lo, eth0 - without ipv6 addresses |
| 32 | #test_run "unix-def_interface_test.xml" test_mitre unix-def_interface_test.xml "true" |
| 33 | |
| 34 | # root needed |
| 35 | if [[ $(id -u) == 0 ]]; then |
| 36 | test_run "unix-def_shadow_test.xml" test_mitre unix-def_shadow_test.xml "true" |
| 37 | fi |
| 38 | |
| 39 | # install xinetd, telnet-server and tftp-server in order to test xinetd probe |
| 40 | if [[ -f "/etc/xinetd.conf" && -f "/etc/xinetd.d/tftp" && -f "/etc/xinetd.d/telnet" ]]; then |
| 41 | test_run "unix-def_xinetd_test.xml" test_mitre unix-def_xinetd_test.xml "true" |
| 42 | fi |
| 43 | |
| 44 | # Unsupported objects on Fedora |
| 45 | #test_run "unix-def_inetd_test.xml" test_mitre unix-def_inetd_test.xml "unknown" |
| 46 | |
| 47 | test_exit cleanup_mitre |