lib/repo: Add min-free-space-percent option, default 3%
For ostree-as-host, we're the superuser, so we'll blow past any reserved free space by default. While deltas have size metadata, if one happens to do a loose fetch, we can fill up the disk. Another case is flatpak: the system helper has similar concerns here as ostree-as-host, and for `flatpak --user`, we also want to be nice and avoid filling up the user's quota. Closes: https://github.com/ostreedev/ostree/issues/962 Closes: #987 Approved by: jlebon
This commit is contained in:
1 parent
8d4d638e99
commit
1f5ce1a9f7
5 files changed
+94
No files matched your search
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Test min-free-space-percent using loopback devices
|
||||
|
||||
set -xeuo pipefail
|
||||
|
||||
dn=$(dirname $0)
|
||||
. ${dn}/libinsttest.sh
|
||||
|
||||
test_tmpdir=$(prepare_tmpdir)
|
||||
trap _tmpdir_cleanup EXIT
|
||||
|
||||
cd ${test_tmpdir}
|
||||
truncate -s 100MB testblk.img
|
||||
blkdev=$(losetup --find --show $(pwd)/testblk.img)
|
||||
mkfs.xfs ${blkdev}
|
||||
mkdir mnt
|
||||
mount ${blkdev} mnt
|
||||
ostree --repo=mnt/repo init --mode=bare-user
|
||||
if ostree --repo=mnt/repo pull-local /ostree/repo ${host_commit} 2>err.txt; then
|
||||
fatal "succeeded in doing a pull with no free space"
|
||||
fi
|
||||
assert_file_has_content err.txt "min-free-space-percent"
|
||||
umount mnt
|
||||
losetup -d ${blkdev}
|
||||
Reference in new issue
Block a user