summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2021-08-20 15:12:21 -0400
committerGitHub <noreply@github.com>2021-08-20 15:12:21 -0400
commit2f675cf1b1afc8053a93077f1427bf40d98554e2 (patch)
tree2ad8dca14254d4c0152d68a28dcc03bcc4f19759 /tests
parent98f3fe3d8ea85525fc11e8dbe63c591ece79b160 (diff)
parent8a5241dd6a6bc4d30195c9d461f50248b0230fc5 (diff)
downloadostree-2f675cf1b1afc8053a93077f1427bf40d98554e2.tar.gz
Merge pull request #2412 from lucab/ups/lib-commit-canonicalize
lib/commit: autofix permissions for bare-user-only
Diffstat (limited to 'tests')
-rw-r--r--tests/basic-test.sh2
-rwxr-xr-xtests/test-basic-user-only.sh14
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/basic-test.sh b/tests/basic-test.sh
index 89d35273..7946ffa3 100644
--- a/tests/basic-test.sh
+++ b/tests/basic-test.sh
@@ -31,7 +31,7 @@ if is_bare_user_only_repo repo; then
# In bare-user-only repos we can only represent files with uid/gid 0, no
# xattrs and canonical permissions, so we need to commit them as such, or
# we end up with repos that don't pass fsck
- COMMIT_ARGS="--canonical-permissions --no-xattrs"
+ COMMIT_ARGS="--no-xattrs"
DIFF_ARGS="--owner-uid=0 --owner-gid=0 --no-xattrs"
# Also, since we can't check out uid=0 files we need to check out in user mode
CHECKOUT_U_ARG="-U"
diff --git a/tests/test-basic-user-only.sh b/tests/test-basic-user-only.sh
index 02129b28..7ef153c3 100755
--- a/tests/test-basic-user-only.sh
+++ b/tests/test-basic-user-only.sh
@@ -25,7 +25,7 @@ set -euo pipefail
mode="bare-user-only"
setup_test_repository "$mode"
-extra_basic_tests=6
+extra_basic_tests=7
. $(dirname $0)/basic-test.sh
$CMD_PREFIX ostree --version > version.yaml
@@ -112,3 +112,15 @@ $OSTREE checkout --force-copy perms out
$OSTREE checkout ${CHECKOUT_H_ARGS} --union-identical perms out
$OSTREE fsck
echo "ok checkout checksum with canonical perms"
+
+cd ${test_tmpdir}
+rm repo -rf
+ostree_repo_init repo init --mode=bare-user-only
+rm files -rf && mkdir files
+echo afile > files/afile
+$OSTREE commit ${COMMIT_ARGS} -b perms files
+rm out -rf
+$OSTREE checkout --force-copy perms out
+$OSTREE checkout ${CHECKOUT_H_ARGS} --union-identical perms out
+$OSTREE fsck
+echo "ok automatic canonical perms for bare-user-only"