3 # test-lib.sh -- library of functions for nfs-utils tests
5 # Copyright (C) 2010 Red Hat, Jeff Layton <jlayton@redhat.com>
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
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 Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # make sure $srcdir is set and sanity check it
24 if [ ! -d ${srcdir} ]; then
25 echo "***ERROR***: bad installation -- \$srcdir=${srcdir}"
29 export PATH=$PATH:${srcdir}:${srcdir}/nsm_client
31 # Some tests require root privileges. Check for them and skip the test (exit 77)
32 # if the caller doesn't have them.
34 if [ $EUID -ne 0 ]; then
35 echo "*** Skipping this test as it requires root privs ***"
40 # is lockd registered as a service?
42 rpcinfo -p | grep -q nlockmgr
48 rpcinfo -u 127.0.0.1 status 1 &> /dev/null
50 echo "***ERROR***: statd is already running and should "
51 echo " be down when starting this test"
54 $srcdir/../utils/statd/statd --no-notify
59 kill `cat /var/run/rpc.statd.pid`