@@ -7192,57 +7192,6 @@ def test__validate_numa_rebuild_alter_numa_toplogy(self):
7192
7192
self .compute_api ._validate_numa_rebuild , instance ,
7193
7193
image , flavor )
7194
7194
7195
- @mock .patch ('nova.pci.request.get_pci_requests_from_flavor' )
7196
- def test_pmu_image_and_flavor_conflict (self , mock_request ):
7197
- """Tests that calling _validate_flavor_image_nostatus()
7198
- with an image that conflicts with the flavor raises but no
7199
- exception is raised if there is no conflict.
7200
- """
7201
- image = {'id' : uuids .image_id , 'status' : 'foo' ,
7202
- 'properties' : {'hw_pmu' : False }}
7203
- flavor = objects .Flavor (
7204
- vcpus = 1 , memory_mb = 512 , root_gb = 1 , extra_specs = {'hw:pmu' : "true" })
7205
- self .assertRaises (
7206
- exception .ImagePMUConflict ,
7207
- self .compute_api ._validate_flavor_image_nostatus ,
7208
- self .context , image , flavor , None )
7209
-
7210
- @mock .patch ('nova.pci.request.get_pci_requests_from_flavor' )
7211
- def test_pmu_image_and_flavor_same_value (self , mock_request ):
7212
- # assert that if both the image and flavor are set to the same value
7213
- # no exception is raised and the function returns nothing.
7214
- flavor = objects .Flavor (
7215
- vcpus = 1 , memory_mb = 512 , root_gb = 1 , extra_specs = {'hw:pmu' : "true" })
7216
-
7217
- image = {'id' : uuids .image_id , 'status' : 'foo' ,
7218
- 'properties' : {'hw_pmu' : True }}
7219
- self .assertIsNone (self .compute_api ._validate_flavor_image_nostatus (
7220
- self .context , image , flavor , None ))
7221
-
7222
- @mock .patch ('nova.pci.request.get_pci_requests_from_flavor' )
7223
- def test_pmu_image_only (self , mock_request ):
7224
- # assert that if only the image metadata is set then it is valid
7225
- flavor = objects .Flavor (
7226
- vcpus = 1 , memory_mb = 512 , root_gb = 1 , extra_specs = {})
7227
-
7228
- # ensure string to bool conversion works for image metadata
7229
- # property by using "yes".
7230
- image = {'id' : uuids .image_id , 'status' : 'foo' ,
7231
- 'properties' : {'hw_pmu' : "yes" }}
7232
- self .assertIsNone (self .compute_api ._validate_flavor_image_nostatus (
7233
- self .context , image , flavor , None ))
7234
-
7235
- @mock .patch ('nova.pci.request.get_pci_requests_from_flavor' )
7236
- def test_pmu_flavor_only (self , mock_request ):
7237
- # assert that if only the flavor extra_spec is set then it is valid
7238
- # and test the string to bool conversion of "on" works.
7239
- flavor = objects .Flavor (
7240
- vcpus = 1 , memory_mb = 512 , root_gb = 1 , extra_specs = {'hw:pmu' : "on" })
7241
-
7242
- image = {'id' : uuids .image_id , 'status' : 'foo' , 'properties' : {}}
7243
- self .assertIsNone (self .compute_api ._validate_flavor_image_nostatus (
7244
- self .context , image , flavor , None ))
7245
-
7246
7195
@mock .patch ('nova.pci.request.get_pci_requests_from_flavor' )
7247
7196
def test_pci_validated (self , mock_request ):
7248
7197
"""Tests that calling _validate_flavor_image_nostatus() with
0 commit comments