ostree/tests/installed/itest-bareuser-nouserxattrs.sh
Colin Walters 23b93a3eb6 lib/repo: Immediately error creating bare-user repo on tmpfs
And in general, if for some reason we can't write `user.` xattrs, provide an
error immediately rather than doing it during a later pull. This way the failure
cause is a lot more obvious.

Related: https://github.com/ostreedev/ostree/issues/991

Closes: #993
Approved by: jlebon
2017-07-06 14:31:37 +00:00

25 lines
584 B
Bash
Executable File

#!/bin/bash
# Test that initializing a bare-user repo on tmpfs fails
# Maybe at some point this will be fixed in the kernel
# but I doubt it'll be soon
# https://www.spinics.net/lists/linux-mm/msg109775.html
set -xeuo pipefail
dn=$(dirname $0)
. ${dn}/libinsttest.sh
test_tmpdir=$(prepare_tmpdir)
trap _tmpdir_cleanup EXIT
cd ${test_tmpdir}
mkdir mnt
mount -t tmpfs tmpfs mnt
if ostree --repo=mnt/repo init --mode=bare-user 2>err.txt; then
umount mnt
assert_not_reached "bare-user on tmpfs worked?"
fi
umount mnt
assert_file_has_content err.txt "Operation not supported"