rewrite Python tests as Bash tests

correct University of Arizona copyright statements

refs #4410

Change-Id: I2e34b28698336d39b64030f68984b711f4bdbd0d
diff --git a/test_ndntraffic/ndntraffic-test.sh b/test_ndntraffic/ndntraffic-test.sh
new file mode 100755
index 0000000..3f494cd
--- /dev/null
+++ b/test_ndntraffic/ndntraffic-test.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+source ../multi-host.conf
+
+clean_up() {
+  r=$(sudo killall ndn-traffic-server 2>&1)
+  r=$(sudo killall ndn-traffic 2>&1)
+  r=$(sudo killall nfd 2>&1)
+}
+
+# A: Start NFD
+workdir=$(pwd)
+echo "starting nfd on A..."
+mkdir -p $workdir/logs; sudo nfd &> $workdir/logs/nfd.log &
+sleep 1
+
+# A: Start ndn-traffic-server
+echo "starting ndn-traffic-server on A..."
+ndn-traffic-server -c 1 $workdir/test-traffic-server.conf &> $workdir/logs/ndn-traffic-server.log &
+serverpid=$!
+sleep 1
+
+# A: Run ndn-traffic
+echo "Running ndn-traffic on A..."
+ndn-traffic -c 1 $workdir/test-traffic-client.conf &> $workdir/logs/ndn-traffic.log
+exitcode=$?
+
+if [[ $exitcode -ne 0 ]]; then
+  echo "Received non-zero exit code from ndn-traffic - actual: $exitcode"
+  clean_up
+  exit 1
+fi
+
+sleep 1
+
+# Verify that ndn-traffic-server has exited
+# ps -p returns 1 if no matching process is found
+ps -p $serverpid > /dev/null
+if [[ $? -ne 1 ]]; then
+  echo "ndn-traffic-server did not exit"
+  clean_up
+  exit 2
+fi
+
+clean_up