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 _begin_fstest metadata udf auto quick
12 # Import common functions.
15 status=0 # success is the default!
17 # real QA test starts here
22 echo "Silence is goodness ..."
24 # ensure target directory exists
25 mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
27 touch $TEST_DIR/$tmp.1
28 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
30 ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
31 x=`$here/src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
34 echo "Arrgh, created link #$l and lstat64 looks like ..."
35 $here/src/lstat64 $TEST_DIR/$tmp.1
40 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
42 x=`$here/src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
45 echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
46 $here/src/lstat64 $TEST_DIR/$tmp.1
49 rm -f $TEST_DIR/$tmp.$l