1 #! /usr/bin/ksh -p
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
26 #
27
28 . ${STF_SUITE}/include/nfsgen.kshlib
29 . ${STF_SUITE}/include/nfs-util.kshlib
30
31 # Turn on debug info, if requested
32 NAME=$(basename $0)
33 [[ :${NFSGEN_DEBUG}: == *:${NAME}:* \
34 || :${NFSGEN_DEBUG}: == *:all:* ]] && set -x
35
36 rm -f $MNTDIR/testfile.*.tmp $STF_TMPDIR/deleg.env
37
38 if [[ -z $CLIENT2 ]] || \
39 [[ $SERVER == $CLIENT2 && $SETUP == "none" ]]; then
40 echo "No cleanup is needed"
41 exit $STF_PASS
42 fi
43
44 if [[ $SERVER == $CLIENT2 ]]; then
45 RUN_CHECK RSH root $CLIENT2 "rm -rf $SRV_TMPDIR/delegation" || \
46 exit $STF_WARNING
47 else
48 if [[ -z $ZONE_PATH ]]; then
49 RUN_CHECK RSH root $CLIENT2 \
50 "\"umount $CLNT2_MNTDIRV4 && \
51 umount $CLNT2_MNTDIRV3 && umount $CLNT2_MNTDIRV2 && rm -fr \
52 $SRV_TMPDIR/delegation $CLNT2_MNTDIRV4 $CLNT2_MNTDIRV3 $CLNT2_MNTDIRV2\"" || \
53 exit $STF_FAIL
54 else
55 RUN_CHECK RSH root $CLIENT2 \
56 "\"umount $CLNT2_MNTDIRV4 && \
57 umount $CLNT2_MNTDIRV3 && rm -fr \
58 $SRV_TMPDIR/delegation $CLNT2_MNTDIRV4 $CLNT2_MNTDIRV3\"" || \
59 exit $STF_FAIL
60 fi
61 fi
62
63 exit $STF_PASS