1#!/bin/sh
2
3################################################################################
4##                                                                            ##
5## Copyright (c) International Business Machines  Corp., 2005                 ##
6##                                                                            ##
7## This program is free software;  you can redistribute it and#or modify      ##
8## it under the terms of the GNU General Public License as published by       ##
9## the Free Software Foundation; either version 2 of the License, or          ##
10## (at your option) any later version.                                        ##
11##                                                                            ##
12## This program is distributed in the hope that it will be useful, but        ##
13## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
14## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
15## for more details.                                                          ##
16##                                                                            ##
17## You should have received a copy of the GNU General Public License          ##
18## along with this program;  if not, write to the Free Software               ##
19## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
20##                                                                            ##
21##                                                                            ##
22################################################################################
23#
24# File:
25#   check_setkey
26#
27# Description:
28#   Check the local/remote host has setkey command
29#
30# Arguments:
31#   None
32#
33# Returns:
34#   0: Both host have setkey command
35#   1: One or both host doesn't have setkey command
36#
37# Author:
38#   Mitsuru Chinen <mitch@jp.ibm.com>
39#
40# History:
41#   Oct 19 2005 - Created (Mitsuru Chinen)
42#
43#-----------------------------------------------------------------------
44#Uncomment line below for debug output.
45#trace_logic=${trace_logic:-"set -x"}
46$trace_logic
47
48
49# Make sure the value of LTPROOT
50LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
51export LTPROOT
52
53# Check the environmanet variable for the test
54. check_envval || exit 1
55
56which setkey >/dev/null 2>&1
57if [ $? -ne 0 ]; then
58    echo "The local host does not have setkey command"
59    exit 1
60fi
61
62ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH which setkey >/dev/null 2>&1 ; echo $?'`
63if [ $ret -ne 0 ]; then
64    echo "The remote host does not have setkey command"
65    exit 1
66fi
67