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
35 echo "Silence is goodness ..."
37 # ensure target directory exists
38 mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
40 touch $TEST_DIR/$tmp.1
41 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
43 ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
44 x=`$here/src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
47 echo "Arrgh, created link #$l and lstat64 looks like ..."
48 $here/src/lstat64 $TEST_DIR/$tmp.1
53 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
55 x=`$here/src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
58 echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
59 $here/src/lstat64 $TEST_DIR/$tmp.1
62 rm -f $TEST_DIR/$tmp.$l