fstests: move test group info to test files
[xfstests-dev.git] / tests / overlay / 013
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test 013
6 #
7 # Test truncate running executable binaries from lower and upper dirs.
8 # truncate(2) should return ETXTBSY, not other errno nor segfault
9 #
10 # Commit 03bea6040932 ("ovl: get_write_access() in truncate") fixed this issue.
11 . ./common/preamble
12 _begin_fstest auto quick copyup
13
14 # Import common functions.
15 . ./common/filter
16
17 # real QA test starts here
18 _supported_fs overlay
19 _require_scratch
20 _require_test_program "t_truncate_self"
21
22 # remove all files from previous runs
23 _scratch_mkfs
24
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
28 mkdir -p $lowerdir
29 mkdir -p $upperdir
30 cp $here/src/t_truncate_self $lowerdir/test_lower
31 cp $here/src/t_truncate_self $upperdir/test_upper
32
33 _scratch_mount
34
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
39
40 # success, all done
41 echo "Silence is golden"
42 status=0
43 exit