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 (at] us.ibm.com) 27 # -Ported 28 #--------------------------------------------------------------------------- 29 30 TST_CNT=2 31 TST_SETUP=setup 32 TST_TESTFUNC=test 33 . tst_test.sh 34 35 LDD=${LDD:=ldd} 36 37 setup() 38 { 39 export LD_LIBRARY_PATH="$TST_DATAROOT:$LD_LIBRARY_PATH" 40 LDDTESTFILE="$TST_DATAROOT/lddfile.out" 41 } 42 43 test1() 44 { 45 46 $LDD $LDDTESTFILE | grep -q -E "lddfile1.obj.so|lddfile2.obj.so|lddfile3.obj.so|lddfile4.obj.so|lddfile5.obj.so" 47 if [ $? -eq 0 ]; then 48 tst_res TPASS "Found lddfile*.obj.so" 49 else 50 tst_res TFAIL "Haven't found lddfile*.obj.so" 51 fi 52 } 53 54 test2() 55 { 56 $LDD -v $LDDTESTFILE | grep -q -E "GLIBC|lddfile1.obj.so|lddfile2.obj.so|lddfile3.obj.so|lddfile4.obj.so|lddfile5.obj.so" 57 if [ $? -eq 0 ]; then 58 tst_res TPASS "Found GLIBC" 59 else 60 tst_res TFAIL "Haven't found GLIBC" 61 fi 62 } 63 64 tst_run 65