File Index
Files and directories
Sign in
FILE

test_generic_05.sh

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/ublk/test_generic_05.sh BASH
 1#!/bin/bash
 2# SPDX-License-Identifier: GPL-2.0
 3
 4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
 5
 6TID="generic_05"
 7ERR_CODE=0
 8
 9ublk_run_recover_test()
10{
11	run_io_and_recover 256M "kill_daemon" "$@"
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_program fio; then
20	exit "$UBLK_SKIP_CODE"
21fi
22
23if ! _have_feature "ZERO_COPY"; then
24	exit "$UBLK_SKIP_CODE"
25fi
26
27_prep_test "recover" "basic recover function verification (zero copy)"
28
29_create_backfile 0 256M
30_create_backfile 1 128M
31_create_backfile 2 128M
32
33ublk_run_recover_test -t null -q 2 -r 1 -z &
34ublk_run_recover_test -t loop -q 2 -r 1 -z "${UBLK_BACKFILES[0]}" &
35ublk_run_recover_test -t stripe -q 2 -r 1 -z "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
36wait
37
38ublk_run_recover_test -t null -q 2 -r 1 -z -i 1 &
39ublk_run_recover_test -t loop -q 2 -r 1 -z -i 1 "${UBLK_BACKFILES[0]}" &
40ublk_run_recover_test -t stripe -q 2 -r 1 -z -i 1 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
41wait
42
43_cleanup_test "recover"
44_show_result $TID $ERR_CODE
~/ Read-only file preview.