test/system: Test that group and user IDs work #1355
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These tests assume that the group and user information on the host operating system can be provided by different plugins for the GNU Name Service Switch (or NSS) functionality of the GNU C Library. eg., on enterprise FreeIPA set-ups. However, it's expected that everything inside the Toolbx container will be provided by
/etc/group
,/etc/passwd
,/etc/shadow
, etc..While
/etc/group
and/etc/passwd
can be read by any user,/etc/shadow
can only be read by root. However, it's awkward to usesudo(8)
in the test cases involving/etc/shadow
, because they ensure thatroot
and$USER
don't need passwords to authenticate inside the container, andsudo(8)
itself depends on that. Ifsudo(8)
is used, the test suite can behave unexpectedly if Toolbx didn't set up the container correctly. eg., it can get blocked waiting for a password.Hence,
podman unshare
is used instead to enter the container's initial user namespace, where$USER
from the host appears asroot
. This is sufficient because the test cases only need to read/etc/shadow
inside the Toolbx container.