xenapi: test_rescue incorrectly verifies original swap wasn't attached

Bug #1290903 reported by Johannes Erdfelt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Johannes Erdfelt

Bug Description

The code currently does:

        vdi_uuids = []
         for vbd_uuid in rescue_vm["VBDs"]:
            vdi_uuids.append(xenapi_fake.get_record('VBD', vbd_uuid)["VDI"])
        self.assertNotIn("swap", vdi_uuids)

vdi_uuids is a list of uuid references. "swap" will never match a uuid, so that test will always be true, even if the code is broken.

Changed in nova:
assignee: nobody → Johannes Erdfelt (johannes.erdfelt)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/79687
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2e7bd74b8d23153a2af81e994101071f9b857909
Submitter: Jenkins
Branch: master

commit 2e7bd74b8d23153a2af81e994101071f9b857909
Author: Johannes Erdfelt <email address hidden>
Date: Tue Mar 11 10:08:51 2014 -0700

    xenapi: Fix test_rescue test to ensure assertions are valid

    The assertion in this test gathers the list of VDI references and then
    checks if the string 'swap' isn't in the list. A VDI reference is a
    UUID, so the string 'swap' will never match, even if the code being
    tested is buggy.

    Compare against an actual VDI reference. Also, add a positive assertion
    to check that the root disk from the original VM is attached.

    Change-Id: I3e3e9798ce63f2f260b7993620fde3749452bfc9
    Closes-bug: 1290903

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
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.