mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-07 21:18:55 +03:00
bb9cd1eb72
This is prep for splitting off "nondestructive" tests which we can run in parallel from the destructive/invasive ones which e.g. change the host refspec, do deployments. The `cd` invocation in `prepare_tmpdir` wasn't working because we were running it in a subshell. Fix this by dropping the subshell. Closes: #1509 Approved by: jlebon
25 lines
592 B
Bash
Executable File
25 lines
592 B
Bash
Executable File
#!/bin/bash
|
|
# Test min-free-space-percent using loopback devices
|
|
|
|
set -xeuo pipefail
|
|
|
|
dn=$(dirname $0)
|
|
. ${dn}/libinsttest.sh
|
|
|
|
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}
|