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