2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
7 # Test truncate running executable binaries from lower and upper dirs.
8 # truncate(2) should return ETXTBSY, not other errno nor segfault
10 # Commit 03bea6040932 ("ovl: get_write_access() in truncate") fixed this issue.
12 _begin_fstest auto quick copyup
14 # Import common functions.
17 # real QA test starts here
20 _require_test_program "t_truncate_self"
22 # remove all files from previous runs
25 # copy test program to lower and upper dir
26 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
27 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
30 cp $here/src/t_truncate_self $lowerdir/test_lower
31 cp $here/src/t_truncate_self $upperdir/test_upper
35 # run test program from lower and upper dir
36 # test programs truncate themselfs, all should fail with ETXTBSY
37 $SCRATCH_MNT/test_lower --may-succeed
38 $SCRATCH_MNT/test_upper
41 echo "Silence is golden"