diff options
| author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-09-17 17:50:41 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-09-17 17:50:41 +0000 |
| commit | 830a85815cc6b53395a91efb93466692dc33fc83 (patch) | |
| tree | f617030c61446d59faf6ccb14fe5a76fa324c583 /nova/tests | |
| parent | 0dc06712aa06a60a582938770a9555b9df90fa22 (diff) | |
| parent | 24db80baa4a5125ba32250b7aa495b58465cfdf5 (diff) | |
When swap is specified as block device mapping, its size becomes 0 wrongly.
This patch make it set to correct size according to instance_type.
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_compute.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index 4d463572b..d600c9f15 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -1563,12 +1563,16 @@ class ComputeTestCase(test.TestCase): db.block_device_mapping_destroy(self.context, bdm['id']) self.compute.terminate_instance(self.context, instance_id) - def test_ephemeral_size(self): + def test_volume_size(self): local_size = 2 - inst_type = {'local_gb': local_size} - self.assertEqual(self.compute_api._ephemeral_size(inst_type, + swap_size = 3 + inst_type = {'local_gb': local_size, 'swap': swap_size} + self.assertEqual(self.compute_api._volume_size(inst_type, 'ephemeral0'), local_size) - self.assertEqual(self.compute_api._ephemeral_size(inst_type, - 'ephemeral1'), + self.assertEqual(self.compute_api._volume_size(inst_type, + 'ephemeral1'), 0) + self.assertEqual(self.compute_api._volume_size(inst_type, + 'swap'), + swap_size) |
