• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3#   Copyright (c) International Business Machines  Corp., 2000
4#
5#   This program is free software;  you can redistribute it and/or modify
6#   it under the terms of the GNU General Public License as published by
7#   the Free Software Foundation; either version 2 of the License, or
8#   (at your option) any later version.
9#
10#   This program is distributed in the hope that it will be useful,
11#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
12#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
13#   the GNU General Public License for more details.
14#
15#   You should have received a copy of the GNU General Public License
16#   along with this program;  if not, write to the Free Software
17#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18#
19#
20#
21#  FILE   : ldd01
22#
23#  PURPOSE: To test the basic functionality of the `ldd` command.
24#
25#  HISTORY:
26#    06/01 Robbie Williamson (robbiew@us.ibm.com)
27#     -Ported
28#
29#
30#---------------------------------------------------------------------------
31#Uncomment line below for debug output
32#trace_logic=${trace_logic:-"set -x"}
33$trace_logic
34
35LDD=${LDD:=ldd}
36TCID=ldd01
37TST_TOTAL=1
38
39. test.sh
40
41do_test()
42{
43
44	export LD_LIBRARY_PATH="$LTP_DATAROOT:$LD_LIBRARY_PATH"
45	LDDTESTFILE="$LTP_DATAROOT/lddfile.out"
46
47	echo "  ASSERTION 1  "
48	$LDD $LDDTESTFILE | grep -E "lddfile1.obj.so|lddfile2.obj.so|lddfile3.obj.so|lddfile4.obj.so|lddfile5.obj.so"
49	if [ $? -eq 0 ]; then
50		echo "ASSERTION #1 PASS"
51	else
52		echo "ASSERTION #1 FAIL"
53		return 1
54	fi
55
56	echo " ASSERTION 2  "
57	$LDD -v $LDDTESTFILE | grep -E "GLIBC|lddfile1.obj.so|lddfile2.obj.so|lddfile3.obj.so|lddfile4.obj.so|lddfile5.obj.so"
58	if [ $? -eq 0 ]; then
59		echo "ASSERTION #2 PASS"
60	else
61		echo "ASSERTION #2 FAIL"
62		return 1
63	fi
64
65	echo "TEST PASSES"
66	return 0
67}
68do_test
69