'test_run_as' functional test failing when running tox with root user

Bug #1777826 reported by yatin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.rootwrap
Confirmed
Medium
Unassigned

Bug Description

'test_run_as' [1] functional test fails with below traceback when running py35 tests with root user:-
py27 test works fine, py35 works if run with non root user(this Test is skipped).

FAIL: oslo_rootwrap.tests.test_functional.RootwrapTest.test_run_as
tags: worker-2
----------------------------------------------------------------------
stdout: {{{99}}}

Traceback (most recent call last):
  File "/root/oslo.rootwrap/oslo_rootwrap/tests/test_functional.py", line 106, in test_run_as
    self.assertEqual('%s\n' % pwd.getpwnam('nobody').pw_uid, out)
  File "/root/oslo.rootwrap/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/root/oslo.rootwrap/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: '99\n' != b'99\n'
Ran 73 tests in 16.071s
FAILED (id=0, failures=1)
error: testr failed (1)
ERROR: InvocationError: '/root/oslo.rootwrap/.tox/py35/bin/python setup.py testr --slowest --testr-args=(?!tests.test_functional_eventlet)tests '
____________________________________________________________________ summary _____________________________________________________________________
ERROR: py35: commands failed

Reproduction step:-

Switch to root user:-
sudo su -
git clone https://github.com/openstack/oslo.rootwrap
cd oslo.rootwrap
tox -epy35

Expected Output:-
The test should pass

[1] https://github.com/openstack/oslo.rootwrap/blob/6285b63572c893391cb1a9e0c482658938f13329/oslo_rootwrap/tests/test_functional.py#L100-L110

Ben Nemec (bnemec)
Changed in oslo.rootwrap:
status: New → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.