2 # Verify that the credentials are changed correctly.
4 # Copyright (C) 2009 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 if test "$VERBOSE" = yes; then
31 # Verify that root credentials are kept.
32 test $
(chroot
/ whoami
) = root || fail
=1
33 test "$(groups)" = "$(chroot / groups)" || fail
=1
35 # Verify that credentials are changed correctly.
36 test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP / whoami)" != root \
39 # Verify that there are no additional groups.
40 test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP --groups= / id -nG)"\
41 = $NON_ROOT_GROUP || fail
=1
43 # Verify that when specifying only the user name we get the current
45 test "$(chroot --userspec=$NON_ROOT_USERNAME / id -g)" = "$(id -g)" \
48 # Verify that when specifying only a group we get the current user ID
49 test "$(chroot --userspec=:$NON_ROOT_GROUP / id -u)" = "$(id -u)" \