summaryrefslogtreecommitdiff
path: root/tests/libtest.sh
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-09-19 18:37:58 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2017-09-19 20:41:36 +0000
commite3c3ec5dd91492e82c79223052443d038c60f41c (patch)
tree8bb09823bf3165d7a903230471c4db67fc89436a /tests/libtest.sh
parentdb10bf464fcf28e3c21724353ffd6168c9f77aae (diff)
downloadostree-e3c3ec5dd91492e82c79223052443d038c60f41c.tar.gz
tests: Reset umask to 022 while creating test repository
In test-basic-root.sh we make assertions about the permissions of files like baz/cow, which were created without an explicit chmod. We can't do that unless we control the permissions. For some reason the "debomatic" autobuilder used to do some Debian archive rebuilds does the entire build including build-time tests as uid 0 with umask 002, which broke those assertions. This seems a weird thing to do, and I've opened a bug, but it also seems reasonable to fix this test. This also lets us remove a couple of existing workarounds for the same issue. Bug-Debian: https://bugs.debian.org/876138 Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: #1192 Approved by: cgwalters
Diffstat (limited to 'tests/libtest.sh')
-rwxr-xr-xtests/libtest.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/libtest.sh b/tests/libtest.sh
index 73e88891..1ae04a74 100755
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -150,6 +150,8 @@ setup_test_repository () {
export OSTREE="${CMD_PREFIX} ostree ${ot_repo}"
cd ${test_tmpdir}
+ local oldumask="$(umask)"
+ umask 022
mkdir files
cd files
ot_files=`pwd`
@@ -172,6 +174,7 @@ setup_test_repository () {
ln -s nonexistent baz/alink
mkdir baz/another/
echo x > baz/another/y
+ umask "${oldumask}"
cd ${test_tmpdir}/files
$OSTREE commit ${COMMIT_ARGS} -b test2 -s "Test Commit 2" -m "Commit body second"