Skip to content

Commit

Permalink
remove mkfs command from imagefile_make()
Browse files Browse the repository at this point in the history
The nuance is that the file system is created taking into account the
block size of the block device. Previously, the file system was created
for a regular file. When creating a block device with a block size of
4KiB, such a whole could not be mounted.
  • Loading branch information
SergeiShtepa committed Nov 24, 2023
1 parent 9c2fbd3 commit 96292a1
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/1000-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ IMAGEFILE_1=${TESTDIR}/simple_1.img
imagefile_make ${IMAGEFILE_1} 64

DEVICE_1=$(loop_device_attach ${IMAGEFILE_1} ${BLOCK_SIZE})
mkfs.ext4 ${DEVICE_1}
echo "new device ${DEVICE_1}"

MOUNTPOINT_1=${MPDIR}/simple_1
Expand All @@ -50,6 +51,7 @@ IMAGEFILE_2=${TESTDIR}/simple_2.img
imagefile_make ${IMAGEFILE_2} 128

DEVICE_2=$(loop_device_attach ${IMAGEFILE_2} ${BLOCK_SIZE})
mkfs.ext4 ${DEVICE_2}
echo "new device ${DEVICE_2}"

MOUNTPOINT_2=${MPDIR}/simple_2
Expand Down
3 changes: 2 additions & 1 deletion tests/1100-loop_diff_storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MPDIR=/mnt/blksnap-test
rm -rf ${MPDIR}
mkdir -p ${MPDIR}

# create first device
# create difference storage device
DIFF_STOGAGE_FILE=${TESTDIR}/diff_storage.img
imagefile_make ${DIFF_STOGAGE_FILE} ${BLk_SZ}

Expand All @@ -36,6 +36,7 @@ IMAGEFILE_1=${TESTDIR}/simple_1.img
imagefile_make ${IMAGEFILE_1} ${BLk_SZ}

DEVICE_1=$(loop_device_attach ${IMAGEFILE_1})
mkfs.ext4 ${DEVICE_1}
echo "new device ${DEVICE_1}"

MOUNTPOINT_1=${MPDIR}/simple_1
Expand Down
1 change: 1 addition & 0 deletions tests/1200-tmpfs_diff_storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ IMAGEFILE_1=${TESTDIR}/simple_1.img
imagefile_make ${IMAGEFILE_1} ${BLK_SZ}

DEVICE_1=$(loop_device_attach ${IMAGEFILE_1})
mkfs.ext4 ${DEVICE_1}
echo "new device ${DEVICE_1}"

MOUNTPOINT_1=${MPDIR}/simple_1
Expand Down
2 changes: 2 additions & 0 deletions tests/1300-tmpfile_diff_storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ BLOCK_SIZE=$(block_size_mnt ${DIFF_STORAGE_DIR})

echo "---"
echo "Simple test start"
echo "devices block size ${BLOCK_SIZE}"

blksnap_load

Expand All @@ -36,6 +37,7 @@ IMAGEFILE_1=${TESTDIR}/simple_1.img
imagefile_make ${IMAGEFILE_1} 64

DEVICE_1=$(loop_device_attach ${IMAGEFILE_1} ${BLOCK_SIZE})
mkfs.ext4 ${DEVICE_1}
echo "new device ${DEVICE_1}"

MOUNTPOINT_1=${MPDIR}/simple_1
Expand Down
1 change: 1 addition & 0 deletions tests/2000-stretch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ IMAGEFILE_1=${TESTDIR}/simple_1.img
imagefile_make ${IMAGEFILE_1} 4096

DEVICE_1=$(loop_device_attach ${IMAGEFILE_1} ${BLOCK_SIZE})
mkfs.ext4 ${DEVICE_1}
echo "new device ${DEVICE_1}"

MOUNTPOINT_1=${MPDIR}/simple_1
Expand Down
1 change: 1 addition & 0 deletions tests/3000-cbt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ IMAGEFILE_1=${TESTDIR}/simple_1.img
imagefile_make ${IMAGEFILE_1} 4096

DEVICE_1=$(loop_device_attach ${IMAGEFILE_1} ${BLOCK_SIZE})
mkfs.ext4 ${DEVICE_1}
echo "new device ${DEVICE_1}"

MOUNTPOINT_1=${MPDIR}/simple_1
Expand Down
1 change: 1 addition & 0 deletions tests/7000-destroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ IMAGEFILE_1=${TESTDIR}/simple_1.img
imagefile_make ${IMAGEFILE_1} 128

DEVICE_1=$(loop_device_attach ${IMAGEFILE_1} ${BLOCK_SIZE})
mkfs.ext4 ${DEVICE_1}
echo "new device ${DEVICE_1}"

MOUNTPOINT_1=${MPDIR}/simple_1
Expand Down
1 change: 0 additions & 1 deletion tests/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ imagefile_make()
local SIZE=$2

dd if=/dev/zero of=${FILEPATH} count=${SIZE} bs=1M status=none
mkfs.ext4 ${FILEPATH}
echo "new image file ${FILEPATH}"
}

Expand Down

0 comments on commit 96292a1

Please sign in to comment.