test_drop_privileges AssertionError groups mismatch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
High
|
Corey Bryant | ||
Ubuntu Cloud Archive |
Fix Released
|
High
|
Unassigned | ||
Pike |
Fix Released
|
High
|
Unassigned | ||
swift (Ubuntu) |
Fix Released
|
High
|
Unassigned |
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_
-------
Traceback (most recent call last):
File "/<<PKGBUILDDIR
self.
AssertionError: Items in the second set but not the first:
110
"""Fail immediately, with the given message."""
>> raise self.failureExc
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.
The failing part of test_drop_
groups = [g.gr_gid for g in grp.getgrall() if user in g.gr_mem]
groups.
self.
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.
Changed in swift (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in swift: | |
assignee: | nobody → Corey Bryant (corey.bryant) |
Changed in swift: | |
status: | In Progress → Confirmed |
importance: | Undecided → High |
Fix proposed to branch: master /review. openstack. org/512797
Review: https:/