blob: 839a76b7c1c53f1b9db84f2add52406b25158675 [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}
Yi Huang53fa8712014-06-10 20:14:26 -07007sudo nfd &> logs/nfd.log &
8sleep 2
9nrd &> logs/nrd.log &
Yi Huang9906f8e2014-04-17 13:28:03 -070010sleep 2
11ndn-traffic-server NDNTrafficServer.conf > logs/server.log 2>&1 &
12sleep 2
13echo "Sending interests..."
14ndn-traffic -i 100 -c 100 NDNTrafficClient.conf > logs/client.log 2>&1
15clean_up
16output=$(grep "Total Interest Loss" logs/client.log | head -1 | cut -d= -f2 | cut -d' ' -f2 | cut -d% -f1)
17if [[ -z $output ]]
18then
19 echo "ndn-traffic client does not end normally. See logs/client.log"
20 exit 1
21fi
Eric Newberryafb5c5f2015-06-09 08:57:58 -070022if [[ $output != 0?(.+(0)) ]]
Yi Huang9906f8e2014-04-17 13:28:03 -070023then
24 echo "Expected no interest Loss. Actual: $output%"
25 echo "For more information, please examine the log at \"$(pwd)/logs\""
26 exit 2
27fi
28echo "Unix Face Test PASSED"