• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) International Business Machines Corp., 2000
4# Author: Robbie Williamson <robbiew@us.ibm.com>
5#
6# test basic functionality of the `ldd` command.
7
8TST_CNT=2
9TST_SETUP=setup
10TST_TESTFUNC=test
11
12LDD=${LDD:=ldd}
13
14setup()
15{
16	export LD_LIBRARY_PATH="$TST_DATAROOT:$LD_LIBRARY_PATH"
17	LDDTESTFILE="$TST_DATAROOT/lddfile.out"
18}
19
20test1()
21{
22
23	$LDD $LDDTESTFILE | grep -q -E "lddfile1.obj.so|lddfile2.obj.so|lddfile3.obj.so|lddfile4.obj.so|lddfile5.obj.so"
24	if [ $? -eq 0 ]; then
25		tst_res TPASS "Found lddfile*.obj.so"
26	else
27		tst_res TFAIL "Haven't found lddfile*.obj.so"
28	fi
29}
30
31test2()
32{
33	$LDD -v $LDDTESTFILE | grep -q -E "GLIBC|lddfile1.obj.so|lddfile2.obj.so|lddfile3.obj.so|lddfile4.obj.so|lddfile5.obj.so"
34	if [ $? -eq 0 ]; then
35		tst_res TPASS "Found GLIBC"
36	else
37		tst_res TFAIL "Haven't found GLIBC"
38	fi
39}
40
41. tst_test.sh
42tst_run
43