File Index
Files and directories
Sign in
FILE

test_generic_14.sh

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/ublk/test_generic_14.sh BASH
 1#!/bin/bash
 2# SPDX-License-Identifier: GPL-2.0
 3
 4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
 5
 6TID="generic_14"
 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
23_prep_test "recover" "basic recover function verification (user copy)"
24
25_create_backfile 0 256M
26_create_backfile 1 128M
27_create_backfile 2 128M
28
29ublk_run_recover_test -t null -q 2 -r 1 -u &
30ublk_run_recover_test -t loop -q 2 -r 1 -u "${UBLK_BACKFILES[0]}" &
31ublk_run_recover_test -t stripe -q 2 -r 1 -u "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
32wait
33
34ublk_run_recover_test -t null -q 2 -r 1 -u -i 1 &
35ublk_run_recover_test -t loop -q 2 -r 1 -u -i 1 "${UBLK_BACKFILES[0]}" &
36ublk_run_recover_test -t stripe -q 2 -r 1 -u -i 1 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
37wait
38
39_cleanup_test "recover"
40_show_result $TID $ERR_CODE
~/ Read-only file preview.