test is leaving behind <MagicMock name='RemoteFsClient().get_mount_point()*

Bug #1659295 reported by Scott DAngelo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Eric Harney

Bug Description

Some test is leaving behind a file:
<MagicMock name='RemoteFsClient().get_mount_point().__iadd__()' id='139649189274320'>.info

Tags: tests
Eric Harney (eharney)
Changed in cinder:
status: New → Confirmed
tags: added: tests
Revision history for this message
Eric Harney (eharney) wrote :

Easy way to figure out how to find what test does this:

$ chmod a-w .
$ tox -e py35

cinder.tests.unit.volume.drivers.test_vzstorage.VZStorageTestCase.test_delete_snapshot_ploop
--------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/eharney/src/cinder-review3/cinder/tests/unit/volume/drivers/test_vzstorage.py", line 331, in test_delete_snapshot_ploop'
    b' self._vz_driver.delete_snapshot(self.snap)'
    b' File "/home/eharney/src/cinder-review3/cinder/volume/drivers/remotefs.py", line 132, in lvo_inner1'
    b' return lvo_inner2()'
    b' File "/home/eharney/src/cinder-review3/.tox/py35/lib/python3.5/site-packages/oslo_concurrency/lockutils.py", line 271, in inner'
    b' return f(*args, **kwargs)'
    b' File "/home/eharney/src/cinder-review3/cinder/volume/drivers/remotefs.py", line 131, in lvo_inner2'
    b' return f(inst, *args, **kwargs)'
    b' File "/home/eharney/src/cinder-review3/cinder/volume/drivers/vzstorage.py", line 659, in delete_snapshot'
    b' self._delete_snapshot_ploop(snapshot)'
    b' File "/home/eharney/src/cinder-review3/cinder/volume/drivers/vzstorage.py", line 583, in _delete_snapshot_ploop'
    b' self._write_info_file(info_path, snap_info)'
    b' File "/home/eharney/src/cinder-review3/cinder/volume/drivers/remotefs.py", line 685, in _write_info_file'
    b" with open(info_path, 'w') as f:"
    b'PermissionError: [Errno 13] Permission denied: "<MagicMock name=\'RemoteFsClient().get_mount_point().__iadd__()\' id=\'139723801234232\'>.info"'
    b''

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/425256

Changed in cinder:
assignee: nobody → Eric Harney (eharney)
status: Confirmed → In Progress
Revision history for this message
Scott DAngelo (scott-dangelo) wrote :

Thanks for the debug tip. I wished I'd have thought of that....

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/425256
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c0bce8cdf56acef9441f88d12cda2ae43538318a
Submitter: Jenkins
Branch: master

commit c0bce8cdf56acef9441f88d12cda2ae43538318a
Author: Eric Harney <email address hidden>
Date: Wed Jan 25 11:09:44 2017 -0500

    Tests: Fix mock for vzstorage remotefs

    This needs to be added to prevent writing a file
    during unit tests.

    Closes-Bug: #1659295

    Change-Id: Ic03d1254b3187785f276e4f745f3ba230078e017

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 10.0.0.0b3

This issue was fixed in the openstack/cinder 10.0.0.0b3 development milestone.

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.