3 #-----------------------------------------------------------------------
4 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # Make sure user cannot overwrite, append, delete or move a file created by
24 # root. Modified CXFSQA test 940960 and 940558.
30 echo "QA output created by $seq"
34 status=0 # success is the default!
36 trap "_cleanup; exit \$status" 0 1 2 3 15
41 rm -rf $my_test_subdir
50 s,.*Permission\sdenied.*,Permission denied,;
51 s,.*no\saccess\sto\stty.*,,;
52 s,.*no\sjob\scontrol\sin\sthis\sshell.*,,;
62 if [ "$HOSTOS" == "IRIX" ]
64 echo $1 | /bin/sh "su $qa_user 2>&1" | _filter_user_do
66 echo $1 | su $qa_user 2>&1 | _filter_user_do
70 # get standard environment, filters and checks
74 # real QA test starts here
75 _supported_fs xfs udf nfs
76 _supported_os Linux IRIX
81 my_test_subdir=$testdir/123subdir
83 # create subdir with required permissions
84 mkdir -m 755 $my_test_subdir
86 echo foo > $my_test_subdir/data_coherency.txt
87 # check basic appending to a file
88 echo bar >> $my_test_subdir/data_coherency.txt
91 _user_do "echo goo >> $my_test_subdir/data_coherency.txt"
94 _user_do "echo goo > $my_test_subdir/data_coherency.txt"
97 _user_do "rm $my_test_subdir/data_coherency.txt"
100 _user_do "mv $my_test_subdir/data_coherency.txt $my_test_subdir/data_coherency2.txt"
102 cat $my_test_subdir/data_coherency.txt