File Index
Files and directories
Sign in
FILE

test_generic_11.sh

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/ublk/test_generic_11.sh BASH
 1#!/bin/bash
 2# SPDX-License-Identifier: GPL-2.0
 3
 4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
 5
 6TID="generic_11"
 7ERR_CODE=0
 8
 9ublk_run_quiesce_recover()
10{
11	run_io_and_recover 256M "quiesce_dev" "$@"
12	ERR_CODE=$?
13	if [ ${ERR_CODE} -ne 0 ]; then
14		echo "$TID failure: $*"
15		_show_result $TID $ERR_CODE
16	fi
17}
18
19if ! _have_feature "QUIESCE"; then
20	exit "$UBLK_SKIP_CODE"
21fi
22
23if ! _have_program fio; then
24	exit "$UBLK_SKIP_CODE"
25fi
26
27_prep_test "quiesce" "basic quiesce & recover function verification"
28
29_create_backfile 0 256M
30_create_backfile 1 128M
31_create_backfile 2 128M
32
33ublk_run_quiesce_recover -t null -q 2 -r 1 &
34ublk_run_quiesce_recover -t loop -q 2 -r 1 "${UBLK_BACKFILES[0]}" &
35ublk_run_quiesce_recover -t stripe -q 2 -r 1 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
36wait
37
38ublk_run_quiesce_recover -t null -q 2 -r 1 -i 1 &
39ublk_run_quiesce_recover -t loop -q 2 -r 1 -i 1 "${UBLK_BACKFILES[0]}" &
40ublk_run_quiesce_recover -t stripe -q 2 -r 1 -i 1 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
41wait
42
43_cleanup_test "quiesce"
44_show_result $TID $ERR_CODE
~/ Read-only file preview.