test_emc_vmax.py should not mock volume_types.get_volume_type_extra_spec globally

Bug #1659481 reported by jiamin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Helen Walsh

Bug Description

in test_emc_vmax.py, EMCV3MultiPoolDriverTestCase mocks volume_types.get_volume_type_extra_specs globally, if other drivers use it and run after it, they will have problem.

6913 volume_types.get_volume_type_extra_specs = mock.Mock(
6914 return_value={'volume_backend_name': 'MULTI_POOL_BE',
6915 'pool_name': 'Bronze+DSS+SRP_1+1234567891011'})

Tags: tests
jiamin (shljia)
description: updated
jiamin (shljia)
summary: - test_emc_vmax.py can not mock volume_types.get_volume_type_extra_spec
+ test_emc_vmax.py should not mock volume_types.get_volume_type_extra_spec
globally
Eric Harney (eharney)
tags: added: tests
Xing Yang (xing-yang)
Changed in cinder:
assignee: nobody → Helen Walsh (walshh2)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Xing Yang (xing-yang) wrote :

Please replace the following mock decorator for volume_types with "with mock.patch.object" inside the test to limit the scope:

    @mock.patch.object(
        volume_types,
        'get_volume_type_extra_specs',
        return_value={'volume_backend_name': 'MULTI_POOL_BE'})
    def test_delete_CG_no_volumes_multi_pool_success(

Please do a search and fix all the mocks for volume_types.

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/425803

Changed in cinder:
status: Confirmed → In Progress
Changed in cinder:
assignee: Helen Walsh (walshh2) → Walt Boring (walter-boring)
Changed in cinder:
assignee: Walt Boring (walter-boring) → Helen Walsh (walshh2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit d063ed99e591f8a81261c0f80125b98d9a94d19f
Author: Helen Walsh <email address hidden>
Date: Thu Jan 26 17:35:32 2017 +0000

    VMAX driver - remove global mock of volume_types

    Some test classes mock volume_types.get_volume_type_extra_specs
    globally, if other drivers use it and run after it, they will
    have problems.

    Change-Id: Ie25c35e8c04457a09f95230185586703b1fce83f
    Closes-Bug: #1659481

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.0rc1

This issue was fixed in the openstack/cinder 10.0.0.0rc1 release candidate.

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.