mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2025-04-19 20:58:31 +09:00

Use global array of $UBLK_BACKFILES for storing all backfile name, then clean them automatically. Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20250412023035.2649275-4-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
21 lines
373 B
Bash
Executable File
21 lines
373 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
|
|
|
|
TID="loop_02"
|
|
ERR_CODE=0
|
|
|
|
_prep_test "loop" "mkfs & mount & umount"
|
|
|
|
_create_backfile 0 256M
|
|
dev_id=$(_add_ublk_dev -t loop "${UBLK_BACKFILES[0]}")
|
|
_check_add_dev $TID $?
|
|
|
|
_mkfs_mount_test /dev/ublkb"${dev_id}"
|
|
ERR_CODE=$?
|
|
|
|
_cleanup_test "loop"
|
|
|
|
_show_result $TID $ERR_CODE
|