#!/bin/bash

group=$1
testName="PINGVIPd1"
testSummary="ping vip of D1"

source ../get_test_values --group=$group
theIP=$d1IP

function test()
{
    local theIP=$1
    ping -w 1 -c 1 $theIP 2>/dev/null 1>/dev/null
    return $?
}

test $theIP; rc=$?
logger -t $LandscapeUseCase -s "Test $testName for $group on node $theIP rc:  $rc"
case $rc in 
    124 | 255 ) # test timeout - set N/A
         rm -f $STATUS_BASE_DIR/.status/${group}_${testName}_OK
         rm -f $STATUS_BASE_DIR/.status/${group}_${testName}_FAIL
         res="NA";
         ;;
    0 ) 
         touch $STATUS_BASE_DIR/.status/${group}_${testName}_OK
         rm -f $STATUS_BASE_DIR/.status/${group}_${testName}_FAIL
          ;;
    * )  rm -f $STATUS_BASE_DIR/.status/${group}_${testName}_OK
         touch $STATUS_BASE_DIR/.status/${group}_${testName}_FAIL
         ;;
esac
