#!/bin/bash

nodeNr=$1
group=$2
testName="CBS${nodeNr}"

echo -n "Test $testName for $group on node $nodeNr "
out=$(timeout 10 ssh root@se0${nodeNr}${group} grep 'transport:.*udpu' /etc/corosync/corosync.conf) 2>/dev/null; rc=$?
#echo "out: $out"
echo "rc:  $rc"
case $rc in 
    124 | 255 ) # test timeout - set N/A
         rm -f ./.status/${group}_${testName}_OK
         rm -f ./.status/${group}_${testName}_FAIL
         res="NA";
         ;;
    0  )
         touch ./.status/${group}_${testName}_OK
         rm -f ./.status/${group}_${testName}_FAIL
          ;;
    * )  rm -f ./.status/${group}_${testName}_OK
         touch ./.status/${group}_${testName}_FAIL
         ;;
esac
