2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Christoph Hellwig. All Rights Reserved.
7 # Check that directory renames onto non-empty targets fail
9 # Based on a bug report and testcase from Vlado Plaga <rechner@vlado-do.de>
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
19 # get standard environment, filters and checks
23 # real QA test starts here
35 # According to the rename(2) manpage you can get either EEXIST or ENOTEMPTY as an
36 # error for trying to rename a non-empty directory, so just catch the error for
37 # ENOTMEMPTY and replace it with the EEXIST output so that either result passes
38 _filter_directory_not_empty()
40 sed -e "s,Directory not empty,File exists,g"
43 trap "_cleanup ; exit \$status" 0 1 2 3 15
53 mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_directory_not_empty