Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Don't assume uid == primary gid #1390

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions tests/test-basic-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,20 @@ cd ${test_tmpdir}
rm -rf test2-checkout
$OSTREE checkout -H -U test2 test2-checkout
# With --link-checkout-speedup, specifying --owner-uid should "win" by default.
myid=$(id -u)
newid=$((${myid} + 1))
$OSTREE commit ${COMMIT_ARGS} --owner-uid ${newid} --owner-gid ${newid} \
myuid=$(id -u)
mygid=$(id -g)
newuid=$((${myuid} + 1))
newgid=$((${mygid} + 1))
$OSTREE commit ${COMMIT_ARGS} --owner-uid ${newuid} --owner-gid ${newgid} \
--link-checkout-speedup -b test2-linkcheckout-test --tree=dir=test2-checkout
$OSTREE ls test2-linkcheckout-test /baz/cow > ls.txt
assert_file_has_content ls.txt "^-006.. ${newid} ${newid} .*/baz/cow"
assert_file_has_content ls.txt "^-006.. ${newuid} ${newgid} .*/baz/cow"

# But --devino-canonical should override that
$OSTREE commit ${COMMIT_ARGS} --owner-uid ${newid} --owner-gid ${newid} \
$OSTREE commit ${COMMIT_ARGS} --owner-uid ${newuid} --owner-gid ${newgid} \
-I -b test2-devino-test --tree=dir=test2-checkout
$OSTREE ls test2-devino-test /baz/cow > ls.txt
assert_file_has_content ls.txt "^-006.. ${myid} ${myid} .*/baz/cow"
assert_file_has_content ls.txt "^-006.. ${myuid} ${mygid} .*/baz/cow"

$OSTREE refs --delete test2-{linkcheckout,devino}-test
echo "ok commit with -I"