4 # Check open by file handle after cycle mount.
6 # This test uses load and store of file handles from a temp file to test
7 # decoding file handles after cycle mount and after directory renames.
9 #-----------------------------------------------------------------------
10 # Copyright (C) 2018 CTERA Networks. All Rights Reserved.
11 # Author: Amir Goldstein <amir73il@gmail.com>
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
47 # real QA test starts here
49 # Modify as appropriate.
53 # _require_exportfs already requires open_by_handle, but let's not count on it
54 _require_test_program "open_by_handle"
58 testroot=$TEST_DIR/$seq-dir
59 testdir=$testroot/testdir
61 # Create test dir and test files, encode file handles and store to tmp file
66 $here/src/open_by_handle -cwp -o $tmp.handles_file $testdir $NUMFILES
69 # Decode file handles loaded from tmp file
75 echo test_file_handles after $when
76 $here/src/open_by_handle $opt -i $tmp.handles_file $TEST_DIR $NUMFILES
79 # Decode file handles of files/dir after cycle mount
82 test_file_handles -rp "cycle mount"
84 # Decode file handles of files/dir after rename of parent and cycle mount
85 create_test_files $testdir
86 rm -rf $testdir.renamed
87 mv $testdir $testdir.renamed/
89 test_file_handles -rp "rename parent"
91 # Decode file handles of files/dir after rename of grandparent and cycle mount
92 create_test_files $testdir
93 rm -rf $testroot.renamed
94 mv $testroot $testroot.renamed/
96 test_file_handles -rp "rename grandparent"
98 # Decode file handles of files/dir after move to new parent and cycle mount
99 create_test_files $testdir
101 mkdir -p $testdir.new
102 mv $testdir/* $testdir.new/
104 test_file_handles -r "move to new parent"