Browse files

test: Fix TestDocker.testFailure on Ubuntu

In the distant past, Ubuntu used the "admin" group for sudoers, before
moving to the "sudo" group like Debian. Its /etc/sudoers still has an
entry for that for backwards compatibility. As our "admin" test image
user also has a primary group "admin" this matches that rule and thus
"usermod -G '' admin" is not sufficient there. Just remove it, as we
don't ever depend on this old group anywhere.

Closes #6109
Reviewed-by: Stef Walter <>
  • Loading branch information...
martinpitt authored and stefwalter committed Mar 15, 2017
1 parent 1c579ff commit 5f7fb4cd66aab89e1ca39ed6791cadec6b079368
Showing with 3 additions and 1 deletion.
  1. +3 −1 test/verify/check-docker
@@ -346,8 +346,10 @@ CMD ["/bin/sh"]
m = self.machine
# Try to access docker without admin (wheel, sudo, ...) group
# also need to disable Ubuntu's legacy "admin" sudo group as it happens
# to have the same name as our admin test user
m.execute("systemctl start docker")
m.execute("usermod -G '' admin")
m.execute("usermod -G '' admin; sed -i '/^%admin/d' /etc/sudoers")
# HACK: Logging in without the admin group will try to write to
# /var/lib/cockpit/, but this will fail.

0 comments on commit 5f7fb4c

Please sign in to comment.