Skip to content

Commit

Permalink
test/system: Test that group and user IDs work
Browse files Browse the repository at this point in the history
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 use sudo(8) in the
test cases involving /etc/shadow, because they ensure that root and
$USER don't need passwords to authenticate inside the container, and
sudo(8) itself depends on that.  If sudo(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 as root.  This is
sufficient because the test cases only need to read /etc/shadow inside
the Toolbx container.

Note that 'run --keep-empty-lines' counts the trailing newline on the
last line as a separate line.

containers#585
  • Loading branch information
debarshiray committed Aug 15, 2023
1 parent 1cc9e07 commit 8284a84
Show file tree
Hide file tree
Showing 2 changed files with 516 additions and 0 deletions.
Loading

0 comments on commit 8284a84

Please sign in to comment.