2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2017 CTERA Networks. All Rights Reserved.
7 # Check stale handles pointing to unlinked files
8 # and non-stale handles pointing to linked files
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # real QA test starts here
31 # Modify as appropriate.
34 # _require_exportfs already requires open_by_handle, but let's not count on it
35 _require_test_program "open_by_handle"
39 testdir=$TEST_DIR/$seq-dir
42 # Create empty test files in test dir
50 $here/src/open_by_handle -c $dir $NUMFILES
53 # Test encode/decode file handles
59 echo test_file_handles $* | _filter_test_dir
60 $here/src/open_by_handle $opt $dir $NUMFILES
63 # Check stale handles to deleted files
64 create_test_files $testdir
65 test_file_handles $testdir -d
67 # Check non-stale handles to linked files
68 create_test_files $testdir
69 test_file_handles $testdir
71 # Check non-stale handles to files that were hardlinked and original deleted
72 create_test_files $testdir
73 test_file_handles $testdir -l
74 test_file_handles $testdir -u