From f46d8e3ec8ae5b60c17d21384b875e8f2ca4bde7 Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Tue, 16 Feb 2021 17:50:06 +0000
Subject: [PATCH] Wait for NDF to finish downloading and check to make sure it
 is non-empty

---
 basice2e/run.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/basice2e/run.sh b/basice2e/run.sh
index dbfa14e..1ca370d 100755
--- a/basice2e/run.sh
+++ b/basice2e/run.sh
@@ -154,9 +154,18 @@ CLIENTCMD="../bin/client getndf --permhost $(cat results/permserver.txt) --cert
 eval $CLIENTCMD >> results/ndf.json 2>&1 &
 PIDVAL=$!
 echo "$CLIENTCMD -- $PIDVAL"
+wait $PIDVAL
 
 cat results/ndf.json | jq . | head -5
 
+file results/ndf.json
+
+if [ ! -s results/ndf.json ]
+then
+    echo "results/ndf.json is empty, cannot proceed"
+    exit -1
+fi
+
 echo "RUNNING CLIENTS..."
 
 runclients() {
-- 
GitLab