Merge "Do not multiply megabytes with 1024 to get gigabytes."

This commit is contained in:
Zuul 2018-02-20 00:39:12 +00:00 committed by Gerrit Code Review
commit 8527fbfd8b
1 changed files with 5 additions and 3 deletions

View File

@ -2567,7 +2567,7 @@ class TestInventory(SchedulerReportClientTestCase):
},
'DISK_GB': {
'total': 10,
'reserved': CONF.reserved_host_disk_mb * 1024,
'reserved': 0, # reserved_host_disk_mb is 0 by default
'min_unit': 1,
'max_unit': compute_node.local_gb,
'step_size': 1,
@ -2583,6 +2583,8 @@ class TestInventory(SchedulerReportClientTestCase):
@mock.patch('nova.scheduler.client.report.SchedulerReportClient.'
'put')
def test_update_inventory(self, mock_put, mock_get):
self.flags(reserved_host_disk_mb=1000)
# Ensure _update_inventory() returns a list of Inventories objects
# after creating or updating the existing values
uuid = uuids.compute_node
@ -2645,7 +2647,7 @@ class TestInventory(SchedulerReportClientTestCase):
},
'DISK_GB': {
'total': 10,
'reserved': CONF.reserved_host_disk_mb * 1024,
'reserved': 1, # this is ceil for 1000MB
'min_unit': 1,
'max_unit': compute_node.local_gb,
'step_size': 1,
@ -2691,7 +2693,7 @@ class TestInventory(SchedulerReportClientTestCase):
},
'DISK_GB': {
'total': 10,
'reserved': CONF.reserved_host_disk_mb * 1024,
'reserved': 0,
'min_unit': 1,
'max_unit': compute_node.local_gb,
'step_size': 1,