2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # ftruncate test, modified from CXFSQA tests cxfs_ftrunc and cxfs_trunc
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "exit \$status" 0 1 2 3 15
18 # get standard environment, filters and checks
22 # real QA test starts here
29 TESTDIR=$TEST_DIR/ftrunc
30 TESTFILE=$TESTDIR/ftrunc.tmp
32 [ -d $TESTDIR ] && rm -r $TESTDIR
35 # ftrunc must be run as a mortal user.
41 # don't use $here/src/ftrunc, as we're running it as a regular user, and $here
42 # may contain path component that a regular user doesn't have search permission
43 su $qa_user -c "./src/ftrunc -f $TESTFILE"
45 if [ "$?" != "0" ]; then
46 echo src/ftrunc returned non 0 status!
49 $here/src/trunc -f $TESTFILE
50 if (test $? -eq 0 ) then