Split logs into test cases to prevent overwriting

refs #2907

Change-Id: Ia7ca07fe0d7cd7428dbba5db443e87983aaaca3f
diff --git a/test_interest_loop/interest-loop-test.sh b/test_interest_loop/interest-loop-test.sh
index a4bae83..93c5b94 100755
--- a/test_interest_loop/interest-loop-test.sh
+++ b/test_interest_loop/interest-loop-test.sh
@@ -4,6 +4,7 @@
 b_ipaddr=$IP4_B1
 c_ipaddr=$IP4_C1
 strategy=$1
+logprefix=$2
 echo "host A IP address $a_ipaddr"
 echo "host B IP address $b_ipaddr"
 echo "host C IP address $c_ipaddr"
@@ -31,12 +32,12 @@
 # start NFD on three nodes and set nexthop to create loop
 echo "start NFD on three nodes and set nexthop to create loop..."
 ssh $CTRL_B "mkdir -p $workdir/logs;\
-    sudo nfd --config $workdir/nfd.conf &> $workdir/logs/nfd.log &\
+    sudo nfd --config $workdir/nfd.conf &> $workdir/logs/${logprefix}_nfd.log &\
     sleep 2"
 ssh $CTRL_C "mkdir -p $workdir/logs;\
-    sudo nfd --config $workdir/nfd.conf &> $workdir/logs/nfd.log &\
+    sudo nfd --config $workdir/nfd.conf &> $workdir/logs/${logprefix}_nfd.log &\
     sleep 2"
-sudo nfd --config $workdir/nfd.conf &> $workdir/logs/nfd.log &
+sudo nfd --config $workdir/nfd.conf &> $workdir/logs/${logprefix}_nfd.log &
 sleep 5
 ssh $CTRL_B "$workdir/add-nexthop.sh $c_ipaddr $strategy"
 ssh $CTRL_C "$workdir/add-nexthop.sh $a_ipaddr $strategy"
@@ -44,22 +45,22 @@
 
 # use ndn-traffic client to send 100 interests
 echo "using ndn-traffic client to send 100 interests..."
-ndn-traffic -c 100 -i 200 NDNTrafficClient.conf > $workdir/logs/client.log 2>&1
+ndn-traffic -c 100 -i 200 NDNTrafficClient.conf > $workdir/logs/${logprefix}_client.log 2>&1
 
 # collect nfd-status from B and C
 echo "collecting nfd-status from B and C..."
-ssh $CTRL_B "nfd-status -f > $workdir/logs/nfd-status-B.log 2>&1"
-scp $CTRL_B:$workdir/logs/nfd-status-B.log  $workdir/logs/nfd-status-B.log
-ssh $CTRL_C "nfd-status -f > $workdir/logs/nfd-status-C.log 2>&1"
-scp $CTRL_C:$workdir/logs/nfd-status-C.log  $workdir/logs/nfd-status-C.log
-nfd-status -f > $workdir/logs/nfd-status-A.log 2>&1
+ssh $CTRL_B "nfd-status -f > $workdir/logs/${logprefix}_nfd-status-B.log 2>&1"
+scp $CTRL_B:$workdir/logs/${logprefix}_nfd-status-B.log  $workdir/logs/${logprefix}_nfd-status-B.log
+ssh $CTRL_C "nfd-status -f > $workdir/logs/${logprefix}_nfd-status-C.log 2>&1"
+scp $CTRL_C:$workdir/logs/${logprefix}_nfd-status-C.log  $workdir/logs/${logprefix}_nfd-status-C.log
+nfd-status -f > $workdir/logs/${logprefix}_nfd-status-A.log 2>&1
 
 # analyze results
 echo "analyzing results..."
 for host in {A..C}
 do
     echo "Host $host:"
-    cat $workdir/logs/nfd-status-$host.log | grep udp4 | while read line
+    cat $workdir/logs/${logprefix}_nfd-status-$host.log | grep udp4 | while read line
     do
         ini=$(echo "$line" | grep -Po "in={.*?i" | sed 's/in={//g' | sed 's/i//g')
         outi=$(echo "$line" | grep -Po "out={.*?i" | sed 's/out={//g' | sed 's/i//g')