xref: /linux/tools/testing/selftests/ublk/test_loop_02.sh (revision 91928e0d3cc29789f4483bffee5f36218f23942b)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
5
6TID="loop_02"
7ERR_CODE=0
8
9_prep_test "loop" "mkfs & mount & umount"
10
11backfile_0=$(_create_backfile 256M)
12dev_id=$(_add_ublk_dev -t loop "$backfile_0")
13_check_add_dev $TID $? "$backfile_0"
14
15_mkfs_mount_test /dev/ublkb"${dev_id}"
16ERR_CODE=$?
17
18_cleanup_test "loop"
19
20_remove_backfile "$backfile_0"
21
22_show_result $TID $ERR_CODE
23