guestagent/test_volume.py leaves a file hanging in /tmp

Bug #1353064 reported by Amrith Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Amrith Kumar

Bug Description

trove/tests/unittests/guestagent/test_volume.py mocks execute() and then calls write_to_fstab().

However, since write_to_fstab() uses execute to delete the file, this leaves a turd in /tmp

Why we use execute() to delete files beats me ... python has a nice os.remove()

Amrith Kumar (amrith)
Changed in trove:
assignee: nobody → Amrith (amrith)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

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

Changed in trove:
status: New → In Progress
Amrith Kumar (amrith)
Changed in trove:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/112118
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=d5176723a5db62935323bc965964656a4ad2bec2
Submitter: Jenkins
Branch: master

commit d5176723a5db62935323bc965964656a4ad2bec2
Author: Amrith Kumar <email address hidden>
Date: Tue Aug 5 15:27:57 2014 -0400

    guestagent/test_volume.py leaves a file in /tmp

    Since the test mocks() execute and then calls write_to_fstab(), the
    file created in /tmp by write_to_fstab() stays around. This is because
    write_to_fstab() uses execute to remove the file. Replaced it with an
    os.remove() and fixed the test which was counting two calls to
    execute().

    I'm fixing it because testing for another bug involves running tox
    over and over again and leaving these files in /tmp is just a bit
    messy.

    Change-Id: Ia9e01049687644abd0671a658dffbbdcb4fba4bd
    Closes-Bug: #1353064

Changed in trove:
status: In Progress → Fix Committed
Changed in trove:
milestone: none → juno-3
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: juno-3 → 2014.2
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.