Test suite failures in TestNetrcCS

Bug #1233413 reported by Andrew Starr-Bochicchio
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Vincent Ladeuil

Bug Description

bzr's testsuite is failing against python 2.7.5-8 from Debian. It's a snapshot from 20130917, taken from the 2.7 branch. The change leading to the issue was introduced here:

http://hg.python.org/cpython/rev/2e19c65d6688/

The reason for is discussed here:

http://bugs.python.org/issue14984

----

Traceback (most recent call last):
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 71, in test_default_password_without_user
    cs = self._get_netrc_cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 53, in _get_netrc_cs
    return config.credential_store_registry.get_credential_store('netrc')
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 2037, in get_credential_store
    cs = cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/__init__.py", line 44, in __init__
    self._netrc = netrc.netrc()
  File "/usr/lib/python2.7/netrc.py", line 33, in __init__
    self._parse(file, fp, default_netrc)
  File "/usr/lib/python2.7/netrc.py", line 111, in _parse
    " the owner", file, lexer.lineno)
NetrcParseError: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/tmp/testbzr-USWnz4.tmp/bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_default_password_without_user/home/.netrc, line 2)

======================================================================
ERROR: bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_default_password
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 66, in test_default_password
    cs = self._get_netrc_cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 53, in _get_netrc_cs
    return config.credential_store_registry.get_credential_store('netrc')
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 2037, in get_credential_store
    cs = cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/__init__.py", line 44, in __init__
    self._netrc = netrc.netrc()
  File "/usr/lib/python2.7/netrc.py", line 33, in __init__
    self._parse(file, fp, default_netrc)
  File "/usr/lib/python2.7/netrc.py", line 111, in _parse
    " the owner", file, lexer.lineno)
NetrcParseError: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/tmp/testbzr-bCDozl.tmp/bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_default_password/home/.netrc, line 2)

======================================================================
ERROR: bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_not_matching_user
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 56, in test_not_matching_user
    cs = self._get_netrc_cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 53, in _get_netrc_cs
    return config.credential_store_registry.get_credential_store('netrc')
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 2037, in get_credential_store
    cs = cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/__init__.py", line 44, in __init__
    self._netrc = netrc.netrc()
  File "/usr/lib/python2.7/netrc.py", line 33, in __init__
    self._parse(file, fp, default_netrc)
  File "/usr/lib/python2.7/netrc.py", line 111, in _parse
    " the owner", file, lexer.lineno)
NetrcParseError: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/tmp/testbzr-rO97ny.tmp/bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_not_matching_user/home/.netrc, line 2)

======================================================================
ERROR: bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_matching_user
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 61, in test_matching_user
    cs = self._get_netrc_cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 53, in _get_netrc_cs
    return config.credential_store_registry.get_credential_store('netrc')
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 2037, in get_credential_store
    cs = cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/__init__.py", line 44, in __init__
    self._netrc = netrc.netrc()
  File "/usr/lib/python2.7/netrc.py", line 33, in __init__
    self._parse(file, fp, default_netrc)
  File "/usr/lib/python2.7/netrc.py", line 111, in _parse
    " the owner", file, lexer.lineno)
NetrcParseError: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/tmp/testbzr-q5Xyys.tmp/bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_matching_user/home/.netrc, line 2)

======================================================================
ERROR: bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_get_netrc_credentials_via_auth_config
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 84, in test_get_netrc_credentials_via_auth_config
    credentials = conf.get_credentials('scheme', 'host', user='joe')
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 1867, in get_credentials
    auth_def.get('password_encoding', None))
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 2012, in decode_password
    cs = credential_store_registry.get_credential_store(encoding)
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 2037, in get_credential_store
    cs = cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/__init__.py", line 44, in __init__
    self._netrc = netrc.netrc()
  File "/usr/lib/python2.7/netrc.py", line 33, in __init__
    self._parse(file, fp, default_netrc)
  File "/usr/lib/python2.7/netrc.py", line 111, in _parse
    " the owner", file, lexer.lineno)
NetrcParseError: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/tmp/testbzr-maf8ca.tmp/bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_get_netrc_credentials_via_auth_config/home/.netrc, line 2)

======================================================================
ERROR: bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_default_password_without_user
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 71, in test_default_password_without_user
    cs = self._get_netrc_cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py", line 53, in _get_netrc_cs
    return config.credential_store_registry.get_credential_store('netrc')
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/config.py", line 2037, in get_credential_store
    cs = cs()
  File "/tmp/buildd/bzr-2.6.0/build/lib.linux-x86_64-2.7/bzrlib/plugins/netrc_credential_store/__init__.py", line 44, in __init__
    self._netrc = netrc.netrc()
  File "/usr/lib/python2.7/netrc.py", line 33, in __init__
    self._parse(file, fp, default_netrc)
  File "/usr/lib/python2.7/netrc.py", line 111, in _parse
    " the owner", file, lexer.lineno)
NetrcParseError: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/tmp/testbzr-USWnz4.tmp/bzrlib.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_default_password_without_user/home/.netrc, line 2)

Related branches

Changed in bzr:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

FWIW, I tried to just chmod 600 the .netrc file in the setUp function, but that doesn't seem to do it...

Revision history for this message
Vincent Ladeuil (vila) wrote :

@Andrew: Weird, given the message and the patch chmod to 600 in the setUp *should* work.
...

Works for me on saucy, will file a merge proposal asap.

Changed in bzr:
status: Triaged → In Progress
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.7b1
status: Fix Committed → Fix Released
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

@Andrew: Looks like the changes to fix this bug have begun colliding with debian/patches/04_test_netrc_fix_perms in the packaging applied to the bzr daily build for Ubuntu Precise, Quantal, and Raring. Example report for Precise from 5 Oct 2013:

 * State: Failed to build
 * Recipe: bzr/bzr-daily
 * Archive: bzr/daily
 * Distroseries: precise
 * Duration: 16 minutes
 * Build Log: https://launchpadlibrarian.net/152590619/buildlog.txt.gz
 * Upload Log:
 * Builder: https://launchpad.net/builders/iridium

Excerpt from buildlog:

Applying patch 04_test_netrc_fix_perms
patching file bzrlib/plugins/netrc_credential_store/tests/test_netrc.py
Hunk #1 FAILED at 43.
1 out of 1 hunk FAILED -- rejects in file bzrlib/plugins/netrc_credential_store/tests/test_netrc.py
Restoring bzrlib/plugins/netrc_credential_store/tests/test_netrc.py
Patch 04_test_netrc_fix_perms can be reverse-applied
Restoring bzrlib/plugins/netrc_credential_store/tests/test_netrc.py
bzr: ERROR: bzrlib.errors.BzrCommandError: Failed to apply quilt patches

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

Should be fix already, no? I see successful builds since then:

https://code.launchpad.net/~bzr/+recipe/bzr-daily
https://code.launchpad.net/~bzr/+archive/daily

Revision history for this message
Richard Wilbur (richard-wilbur) wrote : Re: [Bug 1233413] Re: Test suite failures in TestNetrcCS

Thanks, Andrew. I hadn't checked to see that yesterday and today had
successful builds. Good work!

On Wed, Oct 9, 2013 at 9:20 PM, Andrew Starr-Bochicchio
<email address hidden> wrote:
> Should be fix already, no? I see successful builds since then:
>
> https://code.launchpad.net/~bzr/+recipe/bzr-daily
> https://code.launchpad.net/~bzr/+archive/daily
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1233413
>
> Title:
> Test suite failures in TestNetrcCS
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/bzr/+bug/1233413/+subscriptions

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.