fstests: convert remaining tests to SPDX license tags
[xfstests-dev.git] / tests / generic / 360
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test 360
6 #
7 # Test symlink to very long path, check symlink file contains correct path.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         cd /
21         rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 rm -f $seqres.full
29
30 # real QA test starts here
31 _supported_fs generic
32 _supported_os Linux
33 _require_test
34
35 linkfile=$TEST_DIR/$seq.symlink
36 rm -f $linkfile
37
38 FNAME=$(perl -e 'print "a"x254')
39
40 # Create a symlink points to a very long path, so that the path could not be
41 # hold in inode
42 ln -s $FNAME/$FNAME/$FNAME/$FNAME $linkfile
43
44 # Check symlink contains the correct path.
45 # 1023 chars are a bit long for golden image output, compute the md5 checksum
46 readlink $linkfile | md5sum
47
48 # success, all done
49 status=0
50 exit