Broken test case for IPA standy extension

Bug #1326849 reported by Alexander Gordeev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Ghe Rivero

Bug Description

abnormaly slowest test found:
extensions.standby.TestStandbyExtension.test_cache_image_success 0.375

what I see when I take a closer look why it took so long for me (but not for gating check):

1) It really requests the url from http://example.org (that should be mocked out) in _download_image
2) It really tries to create a file in /tmp. But on my machien it always gets "[Errno 13] Permission denied: '/tmp/fake_id'"
3) This exception is totally ignored because result command_status didn't checked.

https://github.com/openstack/ironic-python-agent/blob/master/ironic_python_agent/tests/extensions/standby.py#L86-L90

Dmitry Tantsur (divius)
tags: added: agent
removed: ironic-python-agent
Changed in ironic:
status: New → Triaged
importance: Undecided → Medium
Ghe Rivero (ghe.rivero)
Changed in ironic:
assignee: nobody → Ghe Rivero (ghe.rivero)
Revision history for this message
Ghe Rivero (ghe.rivero) wrote :

A quick test in my system, passes it really quickly, 0.036... but the test is bogus:
Inside _cache_image
- blockdev is not found in the path (/sbin in a debian system)
- Even if we add the path, needs to be run with root privileges to get some useful information
- If it gets useful information, needs to write the image to the disk, so you can say goodbay to all your data :)

And if any of those things fails, the test will pass because there isn't any assert in the test.

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

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

Changed in ironic:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/99230
Committed: https://git.openstack.org/cgit/openstack/ironic-python-agent/commit/?id=0ee229eb8005b66057bebf63e296a26e8b38d2ad
Submitter: Jenkins
Branch: master

commit 0ee229eb8005b66057bebf63e296a26e8b38d2ad
Author: Ghe Rivero <email address hidden>
Date: Wed Jun 11 00:51:11 2014 +0200

    Remove duplicated test for caching image

    The test test_cache_image_success is (bad) duplicate of the
    test test_cache_image

    The test is trying to retrieve a real url and saving it into
    a block device. Mock several calls to avoid this behavior and
    and assert that the cached image is properly saved.

    Change-Id: Ie2ff5931cc77e5cdd1621c652d73a62fed0b69a6
    Partial-Bug: #1326849

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/99301
Committed: https://git.openstack.org/cgit/openstack/ironic-python-agent/commit/?id=3206ce7c6c88ad645210056dac44da5c3e0ed1fc
Submitter: Jenkins
Branch: master

commit 3206ce7c6c88ad645210056dac44da5c3e0ed1fc
Author: Ghe Rivero <email address hidden>
Date: Mon Jun 16 10:07:06 2014 +0000

    Improve cache_image testing

    Add tests around cache_image functionality to cover other cases:
    - A image is already cached
    - A image is already cached but we use the parameter force to refresh it.

    Change-Id: I9739c2e0d29091d29fa170cf04d953184b8cb54d
    Partial-Bug: #1326849

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