2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
7 # simple inode link count test for a regular file
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
19 status=0 # success is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # real QA test starts here
34 echo "Silence is goodness ..."
36 # ensure target directory exists
37 mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
39 touch $TEST_DIR/$tmp.1
40 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
42 ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
43 x=`$here/src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
46 echo "Arrgh, created link #$l and lstat64 looks like ..."
47 $here/src/lstat64 $TEST_DIR/$tmp.1
52 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
54 x=`$here/src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
57 echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
58 $here/src/lstat64 $TEST_DIR/$tmp.1
61 rm -f $TEST_DIR/$tmp.$l