From 804ae72d2eac7faf1ca57e61135fd0dd4af72033 Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Tue, 13 Mar 2018 10:30:27 +0000
Subject: [PATCH] Made MESH BSN monitor check more robust by also checking
 expected number of SOPs.

---
 applications/apertif/commissioning/central_status.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/applications/apertif/commissioning/central_status.sh b/applications/apertif/commissioning/central_status.sh
index d89cff1ad1..229dd476ee 100755
--- a/applications/apertif/commissioning/central_status.sh
+++ b/applications/apertif/commissioning/central_status.sh
@@ -39,6 +39,8 @@ echo central_status.sh: UniBoards    : $UNBS
 echo central_status.sh: Options      : $OPTIONS
 echo central_status.sh: Polarisation : $POL
 
+NOF_UNIBOARDS=$(echo $UNBS, | grep -o ',' | wc -l)
+
 if [ "$OPTIONS" == "precheck" ]; then
     ###############################################################################
     # Pre  (command sequence) check
@@ -91,4 +93,13 @@ else
         exit 1
     fi
 
+    NOF_BSN_SOPS_EXPECTED=$(($NOF_UNIBOARDS * 8))
+    NOF_BSN_SOPS=$(python $UPE/peripherals/util_bsn_monitor.py --unb $UNBS --fn 0:3 --bn 0:3 -n 1 -r 4 -s MESH | grep -c "nof_sop = 800000")
+    if [ "$NOF_BSN_SOPS" == "$NOF_BSN_SOPS_EXPECTED" ]; then
+        echo central_status.sh: Passed - Found 800000 SOPs per Processing Node post-align MESH BSN monitor
+    else
+        echo "central_status.sh: Error - Not enough SOPs for Processing Node post-align MESH BSN monitor(s)"
+        exit 1
+    fi
+
 fi
-- 
GitLab