Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 475134 - dev-python/python-gflags-2.0: test fails with FEATURES=-userpriv and more
Summary: dev-python/python-gflags-2.0: test fails with FEATURES=-userpriv and more
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: http://code.google.com/p/python-gflag...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-28 19:02 UTC by mike@marineau.org
Modified: 2018-04-21 19:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
python-gflags-2.0-skip-permission-test-as-root.patch (python-gflags-2.0-skip-permission-test-as-root.patch,897 bytes, patch)
2013-06-28 19:02 UTC, mike@marineau.org
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mike@marineau.org 2013-06-28 19:02:29 UTC
Created attachment 352186 [details, diff]
python-gflags-2.0-skip-permission-test-as-root.patch

One unit test in python-gflags checks for a permission denied error on a file that it chmodded to 0. This only works when running as a normal user (i.e. FEATURES=userpriv) because root still can read files with no read access bits set. Considering userpriv is still not the default this is probably a good fix to include.

Reported upstream:
http://code.google.com/p/python-gflags/issues/detail?id=14

I've included a quick fix in an overlay of my own:
https://github.com/marineam/misc-overlay/tree/master/dev-python/python-gflags
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2013-07-04 15:31:44 UTC
python-gflags $ PYTHON_TARGETS="pypy1_9 (or pypy2_0)" ebuild  python-gflags-2.0.ebuild clean test

yields

>>> Source compiled.
 * pypy1_9: running distutils-r1_run_phase python_test OR pypy2_0
.......F...F.
======================================================================
FAIL: testFlagHelpInXML_SpaceSeparatedList (__main__.WriteFlagHelpInXMLFormatTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "gflags_helpxml_test.py", line 253, in testFlagHelpInXML_SpaceSeparatedList
    self._CheckFlagHelpInXML('dirs', 'tool', expected_output)
  File "gflags_helpxml_test.py", line 102, in _CheckFlagHelpInXML
    self.assertMultiLineEqual(sio.getvalue(), expected_output)
  File "/mnt/gen2/TmpDir/portage/dev-python/python-gflags-2.0/work/python-gflags-2.0/tests/gflags_googletest.py", line 104, in assertMultiLineEqual
    unittest.TestCase.assertMultiLineEqual(self, expected, actual)
AssertionError: " <flag>\n   <file>tool</file>\n   <name>dirs</name>\n   <meaning>Directories to [truncated]... != " <flag>\n   <file>tool</file>\n   <name>dirs</name>\n   <meaning>Directories to [truncated]...
   <flag>
     <file>tool</file>
     <name>dirs</name>
     <meaning>Directories to search.</meaning>
     <default>src libs bin</default>
     <current>['src', 'libs', 'bin']</current>
     <type>whitespace separated list of strings</type>
-    <list_separator>' '</list_separator>
     <list_separator>'\t'</list_separator>
     <list_separator>'\n'</list_separator>
-    <list_separator>'\r'</list_separator>
     <list_separator>'\x0b'</list_separator>
     <list_separator>'\x0c'</list_separator>
+    <list_separator>'\r'</list_separator>
+    <list_separator>' '</list_separator>
   </flag>


======================================================================
FAIL: testWriteHelpInXMLFormat (__main__.WriteHelpInXMLFormatTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "gflags_helpxml_test.py", line 527, in testWriteHelpInXMLFormat
    self.assertMultiLineEqual(actual_output, expected_output)
  File "/mnt/gen2/TmpDir/portage/dev-python/python-gflags-2.0/work/python-gflags-2.0/tests/gflags_googletest.py", line 104, in assertMultiLineEqual
    unittest.TestCase.assertMultiLineEqual(self, expected, actual)
AssertionError: '<?xml version="1.0"?>\n<AllFlags>\n  <program>gflags_helpxml_test.py</program>\ [truncated]... != '<?xml version="1.0"?>\n<AllFlags>\n  <program>gflags_helpxml_test.py</program>\ [truncated]...
Diff is 5042 characters long. Set self.maxDiff to None to see it.

----------------------------------------------------------------------
Ran 13 tests in 0.041s

FAILED (failures=2)

dev-python/python-gflags $ PYTHON_TARGETS="python2_7" ebuild  python-gflags-2.0.ebuild clean test

yields

>>> Source compiled.
 * python2_7: running distutils-r1_run_phase python_test
.............
----------------------------------------------------------------------
Ran 13 tests in 0.015s

OK
.........E......EEEWarning: Hit circular flagfile dependency: /mnt/gen2/TmpDir/portage/dev-python/python-gflags-2.0/temp/python2.7/gflags_unittestuxxTfV/UnitTestFile3.tst
EEEEE..E.EEF.........
======================================================================
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-21 19:32:49 UTC
This doesn't seem to happen in 3.1.2.  Feel free to reopen if I tested wrong.