test: Fix too small ext2 block count

The `amd64-separate-usr` autopkgtest fails always in a Debian unstable
schroot environment (with overlayfs) with:

```
genext2fs: couldn't allocate a block (no free space)
```

This is caused by specifying a too small amount of blocks:

```
$ mkdir /tmp/empty
$ genext2fs -b 20 -N 12 -U -d /tmp/empty /tmp/empty.raw
genext2fs: couldn't allocate a block (no free space)
$ genext2fs -b 25 -N 12 -U -d /tmp/empty /tmp/empty.raw
copying from directory /tmp/empty
```

Increase the minimum to 28 blocks solved the failure.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
This commit is contained in:
Benjamin Drung 2023-06-13 11:17:12 +02:00
parent bbe22ecd58
commit 124d98bc25

View File

@ -74,7 +74,7 @@ build_fs_ext2() {
local inodes="$(du --summarize --inodes "${dir}" | cut -f 1)"
# Add fudge factor
blocks="$((blocks + 20 + blocks / 4))"
blocks="$((blocks + 28 + blocks / 4))"
inodes="$((inodes + 10))"
# genext2fs writes status messages to stderr; hide that from