Skip to content

Commit 4759689

Browse files
committed
Corrected the e2e testing script.
1 parent ba2012e commit 4759689

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/run.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Run all tests in directories named test*
44

55
# Expects compiled sender, receiver, and nanotube in corresponding dirs.
6-
# set -e
6+
7+
set -euo pipefail
78

89
PIDS=''
910

@@ -43,7 +44,9 @@ for d in test* ; do
4344
do
4445
sleep 1;
4546
r=$(curl -sS localhost:8024/metrics | grep '^receiver_n_open_ports' | tr -d '\012\015' | cut -d' ' -f2)
46-
[[ $r -gt 0 ]] && break;
47+
if [ "$r" -ne 0 ]; then
48+
break;
49+
fi
4750
done
4851
tOld=$(curl -sS localhost:8024/metrics | grep '^receiver_time_of_last_write' | tr -d '\012\015' | cut -d' ' -f2)
4952

@@ -79,8 +82,10 @@ for d in test* ; do
7982
while true; do
8083
sleep 1;
8184
t=$(curl -sS localhost:8024/metrics | grep '^receiver_time_of_last_write' | tr -d '\012\015' | cut -d' ' -f2)
82-
[ "$t" -eq "$tOld" ] && break;
83-
tOld=t
85+
if [ "$t" = "$tOld" ]; then
86+
break;
87+
fi
88+
tOld=$t
8489
done
8590

8691
kill -TERM $recPID

0 commit comments

Comments
 (0)