2017-09-26 19:41:07 +03:00
#!/bin/bash
# Run test-basic.sh as root.
# https://github.com/ostreedev/ostree/pull/1199
set -xeuo pipefail
2020-03-11 23:00:14 +03:00
. ${ KOLA_EXT_DATA } /libinsttest.sh
fatal "FIXME - need to also sync over the installed tests"
2017-09-26 19:41:07 +03:00
2018-03-22 23:40:35 +03:00
date
2017-09-30 00:42:23 +03:00
# These tests sort of bypass the installed-tests spec;
# fixing that would require installing g-d-t-r, though
# more ideally we architect things with a "control" container
# distinct from the host.
2018-03-22 23:40:35 +03:00
export G_TEST_SRCDIR = $( realpath $dn /../../..)
2017-09-30 00:42:23 +03:00
2017-09-26 19:41:07 +03:00
# Use /var/tmp to hopefully use XFS + O_TMPFILE etc.
2018-03-22 18:36:33 +03:00
prepare_tmpdir /var/tmp
trap _tmpdir_cleanup EXIT
2017-09-26 19:41:07 +03:00
/usr/libexec/installed-tests/libostree/test-basic.sh
2017-09-30 00:42:23 +03:00
/usr/libexec/installed-tests/libostree/test-basic-c
2018-03-22 23:40:35 +03:00
date
2018-04-30 16:46:29 +03:00
# Test error message when opening a non-world-readable object
# https://github.com/ostreedev/ostree/issues/1562
rm repo files -rf
chmod a+rx .
ostree --repo= repo init --mode= bare
mkdir files
touch files/unreadable
chmod 0 files/unreadable
ostree --repo= repo commit -b testbranch --tree= dir = files
# We should be able to read as root due to CAP_DAC_OVERRIDE
ostree --repo= repo cat testbranch /unreadable >/dev/null
if setpriv --reuid bin --regid bin --clear-groups ostree --repo= repo cat testbranch /unreadable 2>err.txt; then
fatal "Listed unreadable object as non-root"
fi
assert_file_has_content err.txt "Opening content object.*openat: Permission denied"
date