blob: 7e378c968b99b263ab4a4731bf6b2686dc239b29 [file] [log] [blame]
#!/bin/sh
################################################################################
## ##
## Copyright (c) International Business Machines Corp., 2005 ##
## ##
## This program is free software; you can redistribute it and#or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation; either version 2 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, but ##
## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
## for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program; if not, write to the Free Software ##
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ##
## ##
## ##
################################################################################
#
# File:
# check_envval
#
# Description:
# Check the environment variable for the network stress test
#
# Returns:
# 0: All necessary environment variables are set.
# 1: Some variables are not set
#
# Author:
# Mitsuru Chinen <mitch@jp.ibm.com>
#
# History:
# Oct 19 2005 - Created (Mitsuru Chinen)
#
#-----------------------------------------------------------------------
#Uncomment line below for debug output.
#trace_logic=${trace_logic:-"set -x"}
$trace_logic
. cmdlib.sh
exists cut locale rsh
# Unset the locale cocerned variables
for env in `locale | cut -f 1 -d '='` ; do
unset $env
done
unset LANGUAGE
# RHOST
RHOST=${RHOST:=127.0.0.1}
if [ x${RHOST} = x ]; then
tst_resm TBROK "Environment variable RHOST is not set."
exit 1
fi
# LHOST_HWADDRS
LHOST_HWADDRS=${LHOST_HWADDRS:=}
if [ x"${LHOST_HWADDRS}" = x ]; then
tst_resm TBROK "Environment variable LHOST_HWADDRS is not set."
exit 1
fi
# RHOST_HWADDRS
RHOST_HWADDRS=${RHOST_HWADDRS:=}
if [ x"${RHOST_HWADDRS}" = x ]; then
tst_resm TBROK "Environment variable RHOST_HWADDRS is not set."
exit 1
fi
# LTP_RSH
LTP_RSH=${LTP_RSH:=}
if [ x"${LTP_RSH}" = x ]; then
LTP_RSH="rsh -n"
elif [ "$LTP_RSH" = "rsh" ]; then
LTP_RSH="rsh -n"
fi
# TMPDIR
TMPDIR=${TMPDIR:=}
if [ x"${TMPDIR}" = x ]; then
TMPDIR=/tmp
fi