#!/bin/bash
exec 2>/dev/null

nodeNr=$1
group=$2
testName="HANA${nodeNr}"
echo -n "Test $testName for $group on node $nodeNr "

out=$(timeout 10 ssh root@se0${nodeNr}${group} su - ha${group#group}adm "HDBSettings.sh landscapeHostConfiguration.py") 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";
         ;;
    1 | 2 | 3 | 4 )
         touch ./.status/${group}_${testName}_OK
         rm -f ./.status/${group}_${testName}_FAIL
          ;;
    * )  rm -f ./.status/${group}_${testName}_OK
         touch ./.status/${group}_${testName}_FAIL
         ;;
esac
