Merge "Increase max_unit in placement test fixture"

This commit is contained in:
Zuul 2018-08-06 20:21:39 +00:00 committed by Gerrit Code Review
commit ef50733478
2 changed files with 9 additions and 19 deletions

View File

@ -159,22 +159,17 @@ class AllocationFixture(APIFixture):
inventory = rp_obj.Inventory( inventory = rp_obj.Inventory(
self.context, resource_provider=rp, self.context, resource_provider=rp,
resource_class='DISK_GB', total=2048, resource_class='DISK_GB', total=2048,
step_size=10, min_unit=10, max_unit=600) step_size=10, min_unit=10, max_unit=1000)
inventory.obj_set_defaults() inventory.obj_set_defaults()
rp.add_inventory(inventory) rp.add_inventory(inventory)
alloc1 = rp_obj.Allocation( alloc = rp_obj.Allocation(
self.context, resource_provider=rp, self.context, resource_provider=rp,
resource_class='DISK_GB', resource_class='DISK_GB',
consumer=consumer, consumer=consumer,
used=500) used=1000)
alloc2 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='DISK_GB',
consumer=consumer,
used=500)
alloc_list = rp_obj.AllocationList( alloc_list = rp_obj.AllocationList(
self.context, self.context,
objects=[alloc1, alloc2] objects=[alloc]
) )
alloc_list.replace_all() alloc_list.replace_all()
@ -190,22 +185,17 @@ class AllocationFixture(APIFixture):
inventory = rp_obj.Inventory( inventory = rp_obj.Inventory(
self.context, resource_provider=rp, self.context, resource_provider=rp,
resource_class='VCPU', total=10, resource_class='VCPU', total=10,
max_unit=4) max_unit=10)
inventory.obj_set_defaults() inventory.obj_set_defaults()
rp.add_inventory(inventory) rp.add_inventory(inventory)
alloc1 = rp_obj.Allocation( alloc = rp_obj.Allocation(
self.context, resource_provider=rp, self.context, resource_provider=rp,
resource_class='VCPU', resource_class='VCPU',
consumer=consumer, consumer=consumer,
used=2) used=6)
alloc2 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='VCPU',
consumer=consumer,
used=4)
alloc_list = rp_obj.AllocationList( alloc_list = rp_obj.AllocationList(
self.context, self.context,
objects=[alloc1, alloc2]) objects=[alloc])
alloc_list.replace_all() alloc_list.replace_all()
# Create a consumer object for a different user # Create a consumer object for a different user

View File

@ -117,7 +117,7 @@ tests:
$.resource_providers.`len`: 0 $.resource_providers.`len`: 0
- name: list resource providers providing resources (no match - more than max_unit) - name: list resource providers providing resources (no match - more than max_unit)
GET: /resource_providers?resources=DISK_GB:610 GET: /resource_providers?resources=DISK_GB:1010
response_json_paths: response_json_paths:
$.resource_providers.`len`: 0 $.resource_providers.`len`: 0