6 # simple inode link count test for a regular file
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
11 # This program is free software; you can redistribute it and/or modify it
12 # under the terms of version 2 of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 # Further, this software is distributed without any warranty that it is
20 # free of the rightful claim of any third person regarding infringement
21 # or the like. Any license provided herein, whether implied or
22 # otherwise, applies only to this software file. Patent licenses, if
23 # any, provided herein do not apply to combinations of this program with
24 # other software, or any other product whatsoever.
26 # You should have received a copy of the GNU General Public License along
27 # with this program; if not, write the Free Software Foundation, Inc., 59
28 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
30 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
31 # Mountain View, CA 94043, or:
35 # For further information regarding this notice, see:
37 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
38 #-----------------------------------------------------------------------
44 echo "QA output created by $seq"
46 # get standard environment, filters and checks
52 status=0 # success is the default!
53 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
55 # real QA test starts here
57 echo "Silence is goodness ..."
59 # ensure target directory exists
60 mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
62 touch $TEST_DIR/$tmp.1
63 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
65 ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
66 x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
69 echo "Arrgh, created link #$l and lstat64 looks like ..."
70 src/lstat64 $TEST_DIR/$tmp.1
75 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
77 x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
80 echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
81 src/lstat64 $TEST_DIR/$tmp.1
84 rm -f $TEST_DIR/$tmp.$l