blob: 0d8e61a11da1e4141c3a090c7b2da46c55583f1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
#
# FSQA Test No. 125
#
# ftruncate test, modified from CXFSQA tests cxfs_ftrunc and cxfs_trunc
#
. ./common/preamble
_begin_fstest other pnfs auto
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs generic
_require_test
_require_user
_require_odirect
_require_chmod
TESTDIR=$TEST_DIR/ftrunc
TESTFILE=$TESTDIR/ftrunc.tmp
[ -d $TESTDIR ] && rm -r $TESTDIR
mkdir $TESTDIR
# ftrunc must be run as a mortal user.
touch $TESTFILE
chmod a+rw $TESTDIR
chmod a+rw $TESTFILE
# don't use $here/src/ftrunc, as we're running it as a regular user, and $here
# may contain path component that a regular user doesn't have search permission
su $qa_user -c "./src/ftrunc -f $TESTFILE"
if [ "$?" != "0" ]; then
echo src/ftrunc returned non 0 status!
fi
$here/src/trunc -f $TESTFILE
if (test $? -eq 0 ) then
status=0
fi
exit
|