2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2021 Oracle. All Rights Reserved.
5 # Boilerplate fstests functionality
7 # Standard cleanup function. Individual tests can override this.
14 # Install the supplied cleanup code as a signal handler for HUP, INT, QUIT,
15 # TERM, or when the test exits. Extra signals can be specified as subsequent
22 test -n "$cleanup" && cleanup="${cleanup}; "
23 trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $*
26 # Prepare to run a fstest by initializing the required global variables to
27 # their defaults, sourcing common functions, registering a cleanup function,
28 # and removing the $seqres.full file.
30 # The list of group memberships for this test (e.g. auto quick rw) must be
31 # passed as arguments to this helper. It is not necessary to name this test
32 # explicitly as a member of the 'all' group.
35 if [ -n "$seq" ]; then
36 echo "_begin_fstest can only be called once!"
42 seqres=$RESULT_DIR/$seq
43 echo "QA output created by $seq"
47 status=1 # failure is the default!
49 _register_cleanup _cleanup
53 # remove previous $seqres.full before test
54 rm -f $seqres.full $seqres.hints