2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Make sure user cannot overwrite, append, delete or move a file created by
8 # root. Modified CXFSQA test 940960 and 940558.
11 _begin_fstest perms auto quick
13 status=0 # success is the default!
15 # Override the default cleanup function.
19 rm -rf $my_test_subdir
23 # Import common functions.
26 # real QA test starts here
32 my_test_subdir=$TEST_DIR/123subdir
34 # create subdir with required permissions
35 mkdir -m 755 $my_test_subdir
37 echo foo > $my_test_subdir/data_coherency.txt
38 # check basic appending to a file
39 echo bar >> $my_test_subdir/data_coherency.txt
42 _user_do "echo goo >> $my_test_subdir/data_coherency.txt"
45 _user_do "echo goo > $my_test_subdir/data_coherency.txt"
48 _user_do "rm $my_test_subdir/data_coherency.txt"
51 _user_do "mv $my_test_subdir/data_coherency.txt $my_test_subdir/data_coherency2.txt"
53 cat $my_test_subdir/data_coherency.txt