Yi Huang | 9906f8e | 2014-04-17 13:28:03 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | mkdir -p logs |
| 3 | clean_up() { |
| 4 | r=$(sudo killall ndn-traffic-server 2>&1) |
| 5 | r=$(sudo killall nfd 2>&1) |
| 6 | } |
| 7 | sudo nfd > logs/nfd.log 2>&1 & |
| 8 | sleep 2 |
| 9 | ndn-traffic-server NDNTrafficServer.conf > logs/server.log 2>&1 & |
| 10 | sleep 2 |
| 11 | echo "Sending interests..." |
| 12 | ndn-traffic -i 100 -c 100 NDNTrafficClient.conf > logs/client.log 2>&1 |
| 13 | clean_up |
| 14 | output=$(grep "Total Interest Loss" logs/client.log | head -1 | cut -d= -f2 | cut -d' ' -f2 | cut -d% -f1) |
| 15 | if [[ -z $output ]] |
| 16 | then |
| 17 | echo "ndn-traffic client does not end normally. See logs/client.log" |
| 18 | exit 1 |
| 19 | fi |
| 20 | if [[ $output != '0' ]] |
| 21 | then |
| 22 | echo "Expected no interest Loss. Actual: $output%" |
| 23 | echo "For more information, please examine the log at \"$(pwd)/logs\"" |
| 24 | exit 2 |
| 25 | fi |
| 26 | echo "Unix Face Test PASSED" |