[nst-cvs] test/argus test.bash,1.1,1.2
A network security analysis and monitoring toolkit Linux distribution.
Brought to you by:
pblankenbaker,
rwhalb
From: Paul B. <pbl...@us...> - 2009-02-21 23:06:07
|
Update of /cvsroot/nst/test/argus In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27240/test/argus Modified Files: test.bash Log Message: Finishing up the Argus package to get it back to a running state on the NST. Index: test.bash =================================================================== RCS file: /cvsroot/nst/test/argus/test.bash,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test.bash 21 Nov 2008 11:58:04 -0000 1.1 --- test.bash 21 Feb 2009 23:06:00 -0000 1.2 *************** *** 3,6 **** --- 3,11 ---- # Make sure man page works + test_require ARGUS_AGENT argus-agent; + test_require ARGUS_CONFIG argus-config; + test_require ARGUSCTL argusctl; + test_require ARGUSD argusd; + test_require BASENAME basename; test_require GREP grep; *************** *** 21,77 **** check_short_help() { ! local f; ! for f in bin/argus-config \ ! sbin/argusctl \ ! sbin/argusd; do ! ! local FILE=/usr/local/argus/${f}; ! local bn=$(${BASENAME} ${f}); ! test_start "Getting --help output for: ${f}"; ! /usr/local/argus/${f} --help 2>&1 < /dev/null | \ ${TEE} ${TEST_DIR}/${bn}-help.txt | \ ${GREP} "[Uu]sage.*${bn}" | \ test_log; test_results "${PIPESTATUS[2]}"; - done ! for f in sbin/argus-agent; do ! local FILE=/usr/local/argus/${f}; ! local bn=$(${BASENAME} ${f}); ! test_start "Verifying that \"${f}\" is executable"; ! [ -x "/usr/local/argus/${f}" ]; ! test_results "${PIPESTATUS[0]}"; done ! } ! ! # restore_to_ship_state ! # ! # Attempts to restore as much as possible of the system ! ! restore_to_ship_state() { ! local URL="${CONTROL_URL}?action=nuke"; ! local FILE="${TEST_DIR}/argus-shutdown.html"; ! ! test_start "Using WUI to nuke any Argus instances"; ! test_wui_get "${URL}" "${FILE}"; ! if [ -s "${FILE}" ]; then ! test_passed; ! else ! test_failed; ! fi ! test_start "Verify \"Argus\" is NOT running"; ! ${SERVICE} argusd status 2>&1 | test_log; ! if [ "${PIPESTATUS[0]}" == "0" ]; then ! test_failed; ! else ! test_passed; ! fi - return 0; } --- 26,60 ---- check_short_help() { ! local FILE; ! for FILE in ${ARGUS_CONFIG} ${ARGUSCTL}; do ! local bn=$(${BASENAME} ${FILE}); ! test_start "Getting --help output for: ${bn}"; ! ${FILE} --help 2>&1 < /dev/null | \ ${TEE} ${TEST_DIR}/${bn}-help.txt | \ ${GREP} "[Uu]sage.*${bn}" | \ test_log; test_results "${PIPESTATUS[2]}"; done ! for FILE in ${ARGUSD}; do ! local bn=$(${BASENAME} ${FILE}); ! test_start "Getting -h output for: ${bn}"; ! ${FILE} -h 2>&1 < /dev/null | \ ! ${TEE} ${TEST_DIR}/${bn}-help.txt | \ ! ${GREP} "[Uu]sage.*${bn}" | \ ! test_log; ! test_results "${PIPESTATUS[2]}"; done ! for FILE in ${ARGUS_AGENT}; do ! local bn=$(${BASENAME} ${FILE}); ! test_start "Verifying that \"${bn}\" is executable"; ! [ -x "${FILE}" ]; ! test_results "${PIPESTATUS[0]}"; ! done } *************** *** 79,100 **** # setup_argus # ! # Function to setup argus via the NST wui. setup_argus() { - local SETUP_URL="${CONTROL_URL}?action=initialize"; - local SETUP_FILE="${TEST_DIR}/setup-argus.html"; - - test_start "Using WUI to setup Argus"; - test_wui_get "${SETUP_URL}" "${SETUP_FILE}"; - if [ -s "${SETUP_FILE}" ]; then - test_passed; - else - test_failed; - exit 1; - fi - - test_start "Verify proper page was returned"; - ${GREP} "Finished.*should be able to run.*argus" "${SETUP_FILE}" &> /dev/null; - test_results "${PIPESTATUS[0]}"; test_start "Starting the Argus service"; --- 62,68 ---- # setup_argus # ! # Function to setup and start argusd setup_argus() { test_start "Starting the Argus service"; *************** *** 161,187 **** shutdown_argus() { - local URL="${CONTROL_URL}?action=nuke"; - local FILE="${TEST_DIR}/argus-shutdown.html"; ! test_start "Stopping the \"Argus\" service"; ${SERVICE} argusd stop 2>&1 | test_log; ! if [ "${PIPESTATUS[0]}" == "0" ]; then ! test_passed; ! else ! test_failed; ! fi ! test_start "Verify \"Argus\" is NOT running"; ${SERVICE} argusd status 2>&1 | test_log; ! if [ "${PIPESTATUS[0]}" == "0" ]; then ! test_failed; ! else ! test_passed; ! fi } - # Scan expects to start as if just booted from ISO - restore_to_ship_state; - # Make sure commands are found and we can get --help output check_short_help; --- 129,143 ---- shutdown_argus() { ! test_start "Stopping the Argus service"; ${SERVICE} argusd stop 2>&1 | test_log; ! test_results "${PIPESTATUS[0]}"; ! test_start "Verify \"argus\" is NOT running"; ${SERVICE} argusd status 2>&1 | test_log; ! [ "${PIPESTATUS[0]}" != "0" ]; ! test_results "${?}"; } # Make sure commands are found and we can get --help output check_short_help; *************** *** 193,199 **** fi - # Restore to ship state - restore_to_ship_state; - # End of all tests --- 149,152 ---- |