[nst-cvs] test/iperf test.bash,NONE,1.1
A network security analysis and monitoring toolkit Linux distribution.
Brought to you by:
pblankenbaker,
rwhalb
From: Paul B. <pbl...@us...> - 2008-10-30 16:34:33
|
Update of /cvsroot/nst/test/iperf In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17825/test/iperf Added Files: test.bash Log Message: * Updated iperf to 2.0.4 * Fixed missing man page * Added service script (you can run: "service iperf start" now) * Added test script to: * Verify man page is present * Verify that the service script looks like it might work * Verify that we can start the server * Verify that we can measure TCP throughput with client * Verify that we can measure UDP throughput with client --- NEW FILE: test.bash --- # ${Id} # # Run some tests on the iperf utility. test_require IPERF iperf; test_require SERVICE service; test_require SLEEP sleep; NAME="iperf"; # # Save current state of service test_service_save ${NAME}; # # Make sure service behaves as expected # test_service ${NAME} 52 48 true; # # Start up server test_start "Starting the \"${NAME}\" service for test"; ${SERVICE} ${NAME} start 2>&1 | test_log; test_results "${PIPESTATUS[0]}"; # # Make sure man page is available # test_man ${NAME}; # # Give a bit of time for server to get ready # SLEEP_TIME="3"; test_start "Giving server ${SLEEP_TIME} seconds to come up"; ${SLEEP} 3 2>&1 | test_log; test_results "${PIPESTATUS[0]}"; # # Run in TCP mode TAG="tcp"; LOG="${TEST_DIR}/${TAG}.log"; CMD="${IPERF} --client 127.0.0.1 --time 3"; test_start "Running: \"${CMD}\""; ${CMD} >| ${LOG} 2>&1; test_results "${PIPESTATUS[0]}"; test_grep "${LOG}" \ "connecting to 127.0.0.1" \ "TCP window size.*[1-9]*.*Byte" \ "port .* connected with 127" \ "3.0 sec"; # # Run in UDP mode TAG="udp"; LOG="${TEST_DIR}/${TAG}.log"; CMD="${IPERF} --client 127.0.0.1 --udp --time 3"; test_start "Running: \"${CMD}\""; ${CMD} >| ${LOG} 2>&1; test_results "${PIPESTATUS[0]}"; test_grep "${LOG}" \ "connecting to 127.0.0.1" \ "UDP buffer size:[ ]*[1-9]*.*Byte" \ "Sent [1-9][0-9]* datagrams" \ "Sending 1470 byte datagrams"; # # Done using service, restore state # test_service_restore ${NAME}; # End of all tests, clean up and exit test_exit; |