File: test.sh

package info (click to toggle)
btrfs-progs 6.2-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,244 kB
  • sloc: ansic: 114,376; sh: 9,576; python: 1,242; makefile: 820
file content (29 lines) | stat: -rwxr-xr-x 664 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# make sure that mkfs.btrfs --rootsize does not change size of the image

source "$TEST_TOP/common"

check_prereq mkfs.btrfs

prepare_test_dev

test_mkfs_with_size() {
	local size
	local imgsize
	local tmp

	size="$1"
	run_check truncate -s"$size" "$TEST_DEV"
	imgsize=$(run_check_stdout stat --format=%s "$TEST_DEV")
	run_check_mkfs_test_dev --rootdir "$INTERNAL_BIN/Documentation"
	tmp=$(run_check_stdout stat --format=%s "$TEST_DEV")
	if ! [ "$imgsize" = "$tmp" ]; then
		_fail "image size changed from $imgsize to $tmp"
	fi
}

test_mkfs_with_size 128M
test_mkfs_with_size 256M
test_mkfs_with_size 512M
test_mkfs_with_size 1G
test_mkfs_with_size 2G