#!/bin/bash

nodeNr=1
group=$2
testName="CRM"
echo -n "Test $testName for $group on node $nodeNr "

out=$(timeout 10 bash -c "ssh root@se0${nodeNr}${group} cibadmin -Ql | grep failure-timeout") 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
