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