local test="$1"
local status="$2"
- printf '%-25s ... %15s' "$test" ''
+ printf '%-60s' "$test ($DESCRIPTION)"
if [[ -z $status ]]; then
echo
return
return
fi
+ if [[ -z $DESCRIPTION ]]; then
+ _warning "${TEST_NAME} does not define DESCRIPTION"
+ return
+ fi
+
if declare -fF test >/dev/null && declare -fF test_device >/dev/null; then
_warning "${TEST_NAME} defines both test() and test_device()"
return
cat << EOF > "tests/${test_name}"
#!/bin/bash
#
-# TODO: provide a brief description of the test here, i.e., what it tests and
-# how. If this is a regression test for a patch, reference the patch title:
+# TODO: provide a description of the test here, i.e., what it tests and how. If
+# this is a regression test for a patch, reference the patch title:
#
# Regression test for patch "blk-stat: fix blk_stat_sum() if all samples are
# batched".
# describing what functionality this tests (e.g., "discard" or "hotplug"). Feel
# free to create new groups if it makes sense.
TEST_GROUPS=($category auto)
+# TODO: fill in a very brief description of what this test does. The
+# description should complete the sentence "This test will...". For example,
+# "run a mixed read/write workload" would be a good description.
+DESCRIPTION=""
# TODO: dmesg is checked after each test run by default. You can suppress this
# by defining:
. common/scsi_debug
TEST_GROUPS=(block auto hotplug)
+DESCRIPTION="stress device hotplugging"
prepare() {
_have_scsi_debug
. common/scsi_debug
TEST_GROUPS=(block auto quick blktrace hotplug)
+DESCRIPTION="remove a device while running blktrace"
prepare() {
_have_blktrace && _have_scsi_debug
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(block auto discard)
+DESCRIPTION="run various discard sizes"
prepare() {
_have_fio
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(block auto flush)
+DESCRIPTION="run lots of flushes"
prepare() {
_have_fio
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(block auto sched)
+DESCRIPTION="switch schedulers while doing IO"
prepare() {
_have_fio
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(block auto)
-
-CHECK_DMESG=1
+DESCRIPTION="run null-blk in blocking mode"
prepare() {
_have_module null_blk
. common/iopoll
TEST_GROUPS=(block auto poll)
+DESCRIPTION="test classic and hybrid IO polling"
prepare() {
_have_fio_with_poll
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(loop auto quick)
+DESCRIPTION="scan loop device partitions"
prepare() {
_have_program parted
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="do nothing"
test() {
echo "Running ${TEST_NAME}"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="do nothing"
test_device() {
echo "Running ${TEST_NAME}"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="exit with non-zero status"
test() {
echo "Running ${TEST_NAME}"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="exit with non-zero status"
test_device() {
echo "Running ${TEST_NAME}"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="produce bad output"
test() {
echo '¯\_(ツ)_/¯'
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="produce lots of bad output"
test() {
for ((i = 1; i <= 100; i++)); do
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="skip in prepare()"
prepare() {
SKIP_REASON="(╯°□°)╯︵ ┻━┻"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="skip in prepare_device()"
prepare_device() {
SKIP_REASON="(╯°□°)╯︵ $TEST_DEV ┻━┻"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="check dmesg"
prepare() {
_have_writeable_kmsg
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="disable check dmesg"
CHECK_DMESG=0
prepare() {
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="filter dmesg"
DMESG_FILTER="grep -v BUG"
prepare() {
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_GROUPS=(meta)
+DESCRIPTION="record pid"
test() {
echo "Running ${TEST_NAME}"