[Bug 1724342] Re: test_drop_privileges AssertionError groups mismatch
Corey Bryant
corey.bryant at canonical.com
Thu Oct 19 19:20:35 UTC 2017
Hello Corey, or anyone else affected,
Accepted swift into pike-proposed. The package will build now and be
available in the Ubuntu Cloud Archive in a few hours, and then in the
-proposed repository.
Please help us by testing this new package. To enable the -proposed
repository:
sudo add-apt-repository cloud-archive:pike-proposed
sudo apt-get update
Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, and change the tag
from verification-pike-needed to verification-pike-done. If it does not
fix the bug for you, please add a comment stating that, and change the
tag to verification-pike-failed. In either case, details of your testing
will help us make a better decision.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance!
** Also affects: cloud-archive
Importance: Undecided
Status: New
** Also affects: cloud-archive/pike
Importance: Undecided
Status: New
** Changed in: cloud-archive/pike
Status: New => Triaged
** Changed in: cloud-archive/pike
Importance: Undecided => High
** Changed in: cloud-archive/pike
Status: Triaged => Fix Committed
** Tags added: verification-pike-needed
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to swift in Ubuntu.
https://bugs.launchpad.net/bugs/1724342
Title:
test_drop_privileges AssertionError groups mismatch
Status in Ubuntu Cloud Archive:
Fix Committed
Status in Ubuntu Cloud Archive pike series:
Fix Committed
Status in OpenStack Object Storage (swift):
Fix Released
Status in swift package in Ubuntu:
Fix Released
Bug description:
This test is failing in Ubuntu builds on Artful. However I think it
generally just gets lucky when it is successful.
======================================================================
FAIL: test_drop_privileges (test.unit.common.test_utils.TestUtils)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/test/unit/common/test_utils.py", line 2151, in test_drop_privileges
self.assertEqual(set(groups), set(os.getgroups()))
AssertionError: Items in the second set but not the first:
110
"""Fail immediately, with the given message."""
>> raise self.failureException('Items in the second set but not the first:\n110')
It seems that setgroups() is mocked out. Part of what drop_privileges() does is:
groups = [g.gr_gid for g in grp.getgrall() if user in g.gr_mem]
os.setgroups(groups)
The failing part of test_drop_privileges() is:
groups = [g.gr_gid for g in grp.getgrall() if user in g.gr_mem]
groups.append(pwd.getpwnam(user).pw_gid)
self.assertEqual(set(groups), set(os.getgroups()))
The test is trying to assert that os.getgroups() was set in
drop_privileges. However os.getgroups() can't change since
os.setgroups() is mocked out, and os.getgroups() isn't mocked out.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1724342/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list