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 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
32 # real QA test starts here
35 _require_test_program "t_truncate_self"
37 # remove all files from previous runs
40 # copy test program to lower and upper dir
41 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
42 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
45 cp $here/src/t_truncate_self $lowerdir/test_lower
46 cp $here/src/t_truncate_self $upperdir/test_upper
50 # run test program from lower and upper dir
51 # test programs truncate themselfs, all should fail with ETXTBSY
52 $SCRATCH_MNT/test_lower --may-succeed
53 $SCRATCH_MNT/test_upper
56 echo "Silence is golden"